You are on page 1of 1

procedure TMainForm.Report1Click(Sender: TObject); var FName, HTML:String; begin FName := ExtractFileDir(Application.ExeName)+'\reports\bukutamu.fr3'; HTML := ExtractFileDir(Application.ExeName)+'\reports\bukutamu.html'; if not FBukuTamu.ZQuery1.Active then FBukuTamu.ZQuery1.

Open; FBukuTamu.Show; FBukuTamu.frxReport1.LoadFromFile(FName); FBukuTamu.frxReport1.PrepareReport(); frxHTMLExport1.FileName := HTML; FBukuTamu.frxReport1.Export(frxHTMLExport1); FBukuTamu.Hide; HTML := '/reports/'+ExtractFileName(HTML); FReport.UniURLFrame1.URL := HTML; FReport.Show; end;

procedure TMainForm.ReportDownloadPDF1Click(Sender: TObject); var FName, PDF:String; begin FName := ExtractFileDir(Application.ExeName)+'\reports\bukutamu.fr3'; PDF := ExtractFileDir(Application.ExeName)+'\reports\bukutamu.pdf'; if not FBukuTamu.ZQuery1.Active then FBukuTamu.ZQuery1.Open; FBukuTamu.Show; FBukuTamu.frxReport1.LoadFromFile(FName); FBukuTamu.frxReport1.PrepareReport(); frxPDFExport1.FileName := PDF; FBukuTamu.frxReport1.Export(frxPDFExport1); FBukuTamu.Hide; Pdf := '/reports/'+ExtractFileName(Pdf); ShowMessage('<b>Berikut Daftar Entri Buku Tamu</b> <br/> <a href="'+pdf+'">Dow nload PDF Report</a>'); end;