【问题标题】:Print two types of pdf different design in fastreport5.0 using delphi xe7使用delphi xe7在fastreport5.0中打印两种不同设计的pdf
【发布时间】:2017-03-12 07:03:41
【问题描述】:

我想获取或生成包含两种设计的报告, 一个必须生成带有文本且没有图像的报告,而另一个必须生成带有图像的报告。 在我的数据集中,我可以识别类别,但我不知道如何一键显示报告,即一键单击我必须能够根据数据集值生成两种设计

【问题讨论】:

    标签: delphi delphi-xe7 fastreport


    【解决方案1】:

    您可以使用 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;
    

    【讨论】:

    • 如果你有带脚本支持的FR,你可以在脚本中使用:procedure Picture1OnBeforePrint(Sender: TfrxComponent); begin Picture1.Visible := ...Type your condution here... end;
    • @gpi 实际上是一样的,除了你必须有脚本支持:)
    猜你喜欢
    • 2018-12-16
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-08
    • 1970-01-01
    • 2015-12-08
    相关资源
    最近更新 更多