简体   繁体   English

Rave向DataText报告

[英]Rave Reports DataText Left

I'm using Delphi 7 and Rave Reports. 我正在使用Delphi 7和Rave Reports。 How can I set the DataText.Left property (from Rave Reports) dinamicaly according to the size of another DataText that comes before. 如何根据之前的另一个DataText的大小设置DataText.Left属性(来自Rave Reports)dinamicaly。 I tried using the width from the previous DataText, the Length of the field that the first DataText is displaying... None of them worked. 我尝试使用前一个DataText的宽度,第一个DataText显示的字段的长度......它们都没有工作。 I would really appreciate it if anyone could give me any ideas. 如果有人能给我任何想法,我将非常感激。

Thanks 谢谢

The Length does not take the width of the characters into account, which will vary depending on the font settings. 长度不考虑字符的宽度,这取决于字体设置。

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

If your loading the data from a DataSet, have a look at the DisplayWidth property of the TField class. 如果从DataSet加载数据,请查看TField类的DisplayWidth属性。

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

或者,根据您需要的确切效果,您也可以只使用一个数据文本,并连接数据/静态文本字段,如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM