zoukankan      html  css  js  c++  java
  • unigui+fastreport报表打印

    unigui+fastreport报表打印

    FASTREPORT导出成PDF报表,UNIGUI的TUniURLFrame显示PDF报表并打印。

    function TfrDM.GenReportPDF(const InvNum: string): string;
    begin
    OpenDS(InvNum);  // 查询报表数据
    try
    frxReport1.PrintOptions.ShowDialog := False;
    frxReport1.ShowProgress := false;

    frxReport1.EngineOptions.SilentMode := True;
    frxReport1.EngineOptions.EnableThreadSafe := True;
    frxReport1.EngineOptions.DestroyForms := False;
    frxReport1.EngineOptions.UseGlobalDataSetList := False;

    frxReport1.LoadFromFile(UniServerModule.FilesFolderPath+'rp.fr3'); // 加载报表模板

    frxPDFExport1.Background := True;
    frxPDFExport1.ShowProgress := False;
    frxPDFExport1.ShowDialog := False;
    frxPDFExport1.FileName := UniServerModule.NewCacheFileUrl(False, 'pdf', '', '', Result, True);
    frxPDFExport1.DefaultPath := '';

    frxReport1.PreviewOptions.AllowEdit := False;
    frxReport1.PrepareReport;
    frxReport1.Export(frxPDFExport1);
    finally
    CloseDS;
    end;
    end;

    procedure TUniForm1.UniFormBeforeShow(Sender: TObject);
    var
    dm : TfrDM;
    RepUrl : string;
    begin
    dm := TfrDM.Create(nil);
    try
    RepUrl := dm.GenReportPDF(InvNum);
    finally
    dm.Free;
    end;

    UniURLFrame1.URL := RepUrl;
    end;

  • 相关阅读:
    上传本地项目到码云(gitee)
    分层自动化测试
    软件测试理论
    python测试
    测试前进之路
    测试常用工具
    Mac python 2.X 升级到 3.X
    cookie处理
    【链接】linuxCentOS权限问题修复(chmod777-R或者chmod755- http://www.cnblogs.com/kofxxf/p/5220836.html
    web开发测试注意点
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/7080681.html
Copyright © 2011-2022 走看看