【发布时间】:2017-03-12 07:03:41
【问题描述】:
我想获取或生成包含两种设计的报告, 一个必须生成带有文本且没有图像的报告,而另一个必须生成带有图像的报告。 在我的数据集中,我可以识别类别,但我不知道如何一键显示报告,即一键单击我必须能够根据数据集值生成两种设计
【问题讨论】:
标签: delphi delphi-xe7 fastreport
我想获取或生成包含两种设计的报告, 一个必须生成带有文本且没有图像的报告,而另一个必须生成带有图像的报告。 在我的数据集中,我可以识别类别,但我不知道如何一键显示报告,即一键单击我必须能够根据数据集值生成两种设计
【问题讨论】:
标签: delphi delphi-xe7 fastreport
您可以使用 FastReport 的 OnBeforePrint 事件,例如:
procedure TMyForm.frxMyReportBeforePrint(Sender: TfrxReportComponent);
begin
if Sender.Name = 'Picture1' then
begin
// Check data set field condition - for example:
if DataSource.DataSet.FieldByName('MyFieldName').AsInteger = 1 then
Sender.Visible := True
else
Sender.Visible := false;
end;
end;
【讨论】:
procedure Picture1OnBeforePrint(Sender: TfrxComponent); begin Picture1.Visible := ...Type your condution here... end;