Jump to content

combine reports


Muhammad Idris

Recommended Posts

I can combine several reports in FastReport, but How do I combine the report with a PDF file in a file/folder in FastReport ?

my code :

 

procedure TFLap_SBPK.PrepareAndShow(Report: TfrxReport; Exp: TfrxPDFExport);
var
  AUrl : string;
begin
  Report.PrintOptions.ShowDialog := False;
  Report.ShowProgress := false;

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

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

  Report.PreviewOptions.AllowEdit := False;
  Report.PrepareReport;

  if Billing = '1' then
  begin
    frxRekapBPJS.PrepareReport;
    Report.PreviewPages.AddFrom(frxRekapBPJS);
  end;
  if Resume = '1' then
  begin
    frxRadiologi.PrepareReport;
    Report.PreviewPages.AddFrom(frxRadiologi);
  end;
  if Konsul = '1' then
  begin
    frxKonsul.PrepareReport;
    Report.PreviewPages.AddFrom(frxKonsul);
  end;
  if Jawab = '1' then
  begin
    frxJawab.PrepareReport;
    Report.PreviewPages.AddFrom(frxJawab);
  end;
  if Terapi = '1' then
  begin
    frxTerapi.PrepareReport;
    Report.PreviewPages.AddFrom(frxTerapi);
  end;
  if Fisik = '1' then
  begin
    frxFisik.PrepareReport;
    Report.PreviewPages.AddFrom(frxFisik);
  end;
  if PermintaanTerapi = '1' then
  begin
    frxPermintaanTerapi.PrepareReport;
    Report.PreviewPages.AddFrom(frxPermintaanTerapi);
  end;
  if Kematian = '1' then
  begin
    frxKematian.PrepareReport;
    Report.PreviewPages.AddFrom(frxKematian);
  end;
  if RujukKeluarRS = '1' then
  begin
    frxRujuk.PrepareReport;
    Report.PreviewPages.AddFrom(frxRujuk);
  end;
  if Lain = '1' then
  begin
    FUrl := UniServerModule.FilesFolderURL + 'eKlaim_PDF/';
    frxReport1.LoadFromFile(FUrl+QBiayaNama_File.AsString);
    frxReport1.PrepareReport;
    Report.PreviewPages.AddFrom(frxReport1);
  end;

  Report.Export(Exp);

  UniPDFFrame1.PdfURL := AUrl + '#page=1&zoom=100';
end;

  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...
On 9/10/2023 at 12:19 AM, Muhammad Idris said:

I can combine several reports in FastReport, but How do I combine the report with a PDF file in a file/folder in FastReport ?

my code :

 

procedure TFLap_SBPK.PrepareAndShow(Report: TfrxReport; Exp: TfrxPDFExport);
var
  AUrl : string;
begin
  Report.PrintOptions.ShowDialog := False;
  Report.ShowProgress := false;

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

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

  Report.PreviewOptions.AllowEdit := False;
  Report.PrepareReport;

  if Billing = '1' then
  begin
    frxRekapBPJS.PrepareReport;
    Report.PreviewPages.AddFrom(frxRekapBPJS);
  end;
  if Resume = '1' then
  begin
    frxRadiologi.PrepareReport;
    Report.PreviewPages.AddFrom(frxRadiologi);
  end;
  if Konsul = '1' then
  begin
    frxKonsul.PrepareReport;
    Report.PreviewPages.AddFrom(frxKonsul);
  end;
  if Jawab = '1' then
  begin
    frxJawab.PrepareReport;
    Report.PreviewPages.AddFrom(frxJawab);
  end;
  if Terapi = '1' then
  begin
    frxTerapi.PrepareReport;
    Report.PreviewPages.AddFrom(frxTerapi);
  end;
  if Fisik = '1' then
  begin
    frxFisik.PrepareReport;
    Report.PreviewPages.AddFrom(frxFisik);
  end;
  if PermintaanTerapi = '1' then
  begin
    frxPermintaanTerapi.PrepareReport;
    Report.PreviewPages.AddFrom(frxPermintaanTerapi);
  end;
  if Kematian = '1' then
  begin
    frxKematian.PrepareReport;
    Report.PreviewPages.AddFrom(frxKematian);
  end;
  if RujukKeluarRS = '1' then
  begin
    frxRujuk.PrepareReport;
    Report.PreviewPages.AddFrom(frxRujuk);
  end;
  if Lain = '1' then
  begin
    FUrl := UniServerModule.FilesFolderURL + 'eKlaim_PDF/';
    frxReport1.LoadFromFile(FUrl+QBiayaNama_File.AsString);
    frxReport1.PrepareReport;
    Report.PreviewPages.AddFrom(frxReport1);
  end;

  Report.Export(Exp);

  UniPDFFrame1.PdfURL := AUrl + '#page=1&zoom=100';
end;

Is there a solution to this problem?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...