Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Bottom part of lower case RichText get chop off in ReportBuilder 15

edited January 2014 in General
Hi,

I have a simple RichText control fill with lower case text:
"abcdefgjqxyz" in Tahoma font. The RichText control is set to stretch.

The bottom part of those text get chop off. This problem doesn't happen
in ReportBuilder 14.

The following are TppReport and TppJITPipeline components for testing:

object ppReport1: TppReport
AutoStop = False
DataPipeline = ppJITPipeline1
PrinterSetup.BinName = 'Default'
PrinterSetup.DocumentName = 'Report'
PrinterSetup.PaperName = 'Letter'
PrinterSetup.PrinterName = 'Default'
PrinterSetup.SaveDeviceSettings = False
PrinterSetup.mmMarginBottom = 6350
PrinterSetup.mmMarginLeft = 6350
PrinterSetup.mmMarginRight = 6350
PrinterSetup.mmMarginTop = 6350
PrinterSetup.mmPaperHeight = 279400
PrinterSetup.mmPaperWidth = 215900
PrinterSetup.PaperSize = 1
Template.Format = ftASCII
ArchiveFileName = '($MyDocuments)\ReportArchive.raf'
DeviceType = 'Screen'
DefaultFileDeviceType = 'PDF'
EmailSettings.ReportFormat = 'PDF'
LanguageID = 'Default'
OpenFile = False
OutlineSettings.CreateNode = True
OutlineSettings.CreatePageNodes = True
OutlineSettings.Enabled = True
OutlineSettings.Visible = True
ThumbnailSettings.Enabled = True
ThumbnailSettings.Visible = True
ThumbnailSettings.DeadSpace = 30
PDFSettings.EmbedFontOptions = [efUseSubset]
PDFSettings.EncryptSettings.AllowCopy = True
PDFSettings.EncryptSettings.AllowInteract = True
PDFSettings.EncryptSettings.AllowModify = True
PDFSettings.EncryptSettings.AllowPrint = True
PDFSettings.EncryptSettings.Enabled = False
PDFSettings.EncryptSettings.KeyLength = kl40Bit
PDFSettings.FontEncoding = feAnsi
PDFSettings.ImageCompressionLevel = 25
PreviewFormSettings.WindowState = wsMaximized
PreviewFormSettings.ZoomSetting = zsPageWidth
RTFSettings.DefaultFont.Charset = DEFAULT_CHARSET
RTFSettings.DefaultFont.Color = clWindowText
RTFSettings.DefaultFont.Height = -17
RTFSettings.DefaultFont.Name = 'Arial'
RTFSettings.DefaultFont.Style = []
TextFileName = '($MyDocuments)\Report.pdf'
TextSearchSettings.DefaultString = ''
TextSearchSettings.Enabled = True
XLSSettings.AppName = 'ReportBuilder'
XLSSettings.Author = 'ReportBuilder'
XLSSettings.Subject = 'Report'
XLSSettings.Title = 'Report'
Left = 208
Top = 80
Version = '15.02'
mmColumnWidth = 0
DataPipelineName = 'ppJITPipeline1'
object ppDetailBand1: TppDetailBand
Background1.Brush.Style = bsClear
Background2.Brush.Style = bsClear
PrintHeight = phDynamic
mmBottomOffset = 0
mmHeight = 19685
mmPrintPosition = 0
object ppRichText1: TppRichText
UserName = 'RichText1'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Name = 'Tahoma'
Font.Size = 8
Font.Style = []
Caption = 'RichText1'
Color = clSilver
RichText =

'{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcha' +
'rset0 Tahoma;}{\f1\fnil Tahoma;}}'#13#10'{\colortbl
;\red0\green0\blue' +

'0;}'#13#10'\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs40 abcde' +
'fgjqxyz\cf1\lang1033\f1\fs16\par'#13#10'}'#13#10#0
RemoveEmptyLines = False
Stretch = True
mmHeight = 15028
mmLeft = 95250
mmTop = 2752
mmWidth = 102024
BandType = 4
LayerName = Foreground
mmBottomOffset = 0
mmOverFlowOffset = 0
mmStopPosition = 0
mmMinHeight = 0
end
object ppRichText2: TppRichText
UserName = 'RichText2'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Name = 'Tahoma'
Font.Size = 8
Font.Style = []
Caption = 'RichText2'
Color = clSilver
RichText =

'{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcha' +
'rset0 Tahoma;}{\f1\fnil Tahoma;}}'#13#10'{\colortbl
;\red0\green0\blue' +

'0;}'#13#10'\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs40 abcde' +
'fgjqxyz\cf1\lang1033\f1\fs16\par'#13#10'}'#13#10#0
RemoveEmptyLines = False
mmHeight = 15028
mmLeft = 3175
mmTop = 2752
mmWidth = 88900
BandType = 4
LayerName = Foreground
mmBottomOffset = 0
mmOverFlowOffset = 0
mmStopPosition = 0
mmMinHeight = 0
end
end
object ppDesignLayers1: TppDesignLayers
object ppDesignLayer1: TppDesignLayer
UserName = 'Foreground'
LayerType = ltBanded
Index = 0
end
end
object ppParameterList1: TppParameterList
end
end
object ppJITPipeline1: TppJITPipeline
InitialIndex = 0
RecordCount = 1
UserName = 'JITPipeline1'
Left = 120
Top = 80
end

--
Best Regards,
Chau Chee Yang

Comments

  • edited January 2014
    I think this is a bug in ReportBuilder 15.

    In ReportBuilder 15, the method function TppDrawRichText.Draw() has removed.

    A calculation of RichText height seems wrong in method:

    class function TppRTFEngine.CalcSingleLineHeight(aRichEdit:
    TCustomRichEdit; aDC: HDC; aCharRange: TCharRange; aDestRect: TRect):
    Integer;
    begin
    ...
    Result := Round(Abs(liMaxFontSize) * liPixelsPerInchY / 72) +
    lTextMetric.tmDescent;
    ...
    end;

    A solution could be:

    class function TppRTFEngine.CalcSingleLineHeight(aRichEdit:
    TCustomRichEdit; aDC: HDC; aCharRange: TCharRange; aDestRect: TRect):
    Integer;
    begin
    ...
    Result := Round(Abs(liMaxFontSize) * liPixelsPerInchY / 72 +
    lTextMetric.tmDescent * lTextMetric.tmDigitizedAspectY / 72);
    ...
    end;


  • edited January 2014
    Hi Chau Chee,

    Thank you for the information and research.

    There is now a patch available for RB 15.02 that solves this issue.
    Send an email to support@digital-metaphors.com to receive the patch.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.