Delphi Rave报告数据文本左侧

Delphi Rave报告数据文本左侧,delphi,delphi-7,rave-reports,datatextfield,Delphi,Delphi 7,Rave Reports,Datatextfield,我正在使用Delphi7和Rave报告。 如何根据前面的另一个DataText的大小来设置DataText.Left属性(来自Rave Reports)。 我尝试使用前一个DataText的宽度,第一个DataText显示的字段长度。。。他们都没有工作。 如果有人能给我一些建议,我将不胜感激 谢谢长度不考虑字符的宽度,这将根据字体设置而有所不同 // Assumes the AutoSize property is true. // Note: 8 is added as spacing Dat

我正在使用Delphi7和Rave报告。 如何根据前面的另一个DataText的大小来设置DataText.Left属性(来自Rave Reports)。 我尝试使用前一个DataText的宽度,第一个DataText显示的字段长度。。。他们都没有工作。 如果有人能给我一些建议,我将不胜感激


谢谢

长度不考虑字符的宽度,这将根据字体设置而有所不同

// Assumes the AutoSize property is true.
// Note: 8 is added as spacing
DataText.Left := LastDataText.Left + LastDataText.Width + 8;
如果要从数据集加载数据,请查看TField类的属性

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

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

<FieldName> + ' Some text ' + <Param.ParamName> + ' Some other text'
+'一些文本'++'一些其他文本'

我尚未测试上述代码。我需要检查快速报告。画布是正确的。