Rave向DataText报告

时间:2010-01-22 13:06:57

标签: delphi delphi-7 rave-reports datatextfield

我正在使用Delphi 7和Rave Reports。 如何根据之前的另一个DataText的大小设置DataText.Left属性(来自Rave Reports)dinamicaly。 我尝试使用前一个DataText的宽度,第一个DataText显示的字段的长度......它们都没有工作。 如果有人能给我任何想法,我将非常感激。

由于

2 个答案:

答案 0 :(得分:0)

长度不考虑字符的宽度,这取决于字体设置。

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

如果从DataSet加载数据,请查看TField类的DisplayWidth属性。

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

答案 1 :(得分:0)

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

<FieldName> + ' Some text ' + <Param.ParamName> + ' Some other text'
相关问题