Rave Reports DataText Left

I am using Delphi 7 and Rave Reports. How can I set the DataText.Left (from Rave Reports) dinamicaly property to fit the size of another DataText that precedes. I tried using the width from the previous DataText, The length of the field that the first DataText shows ... None of them worked. I would really appreciate it if anyone could give me any ideas.

thank

+3
source share
2 answers

The length does not take into account the character width, which depends on the font settings.

// Assumes the AutoSize property is true.
// Note: 8 is added as spacing
DataText.Left := LastDataText.Left + LastDataText.Width + 8;

If you are loading data from a DataSet, look at the DisplayWidth property of the TField class.

// calculate the width of the last field.
TextWidth := DataSet.Fields[0].DisplayWidth * QuickReport.Canvas.TextWidth('M');
DataText.Left := LastDataText.Left + TextWidth;
0
source

, , , / :

<FieldName> + ' Some text ' + <Param.ParamName> + ' Some other text'
0

Source: https://habr.com/ru/post/1729558/


All Articles