warat mookdaanan Posted November 19, 2019 Share Posted November 19, 2019 when i fast report to pdf it can download to doc,xls by click download or how i must to do like this Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2019 Share Posted November 19, 2019 1 hour ago, warat mookdaanan said: how i must to do like this Unfortunately, pdfjs (what you indicate in the screenshot) cannot convert pdf to word... Quote Link to comment Share on other sites More sharing options...
warat mookdaanan Posted November 19, 2019 Author Share Posted November 19, 2019 function Frm_PDF_Tobuy: TFrm_PDF_Tobuy; begin Result := TFrm_PDF_Tobuy(UniMainModule.GetFormInstance(TFrm_PDF_Tobuy)); end; procedure TFrm_PDF_Tobuy.CloseDS; begin UniQueryAll.Close end; procedure TFrm_PDF_Tobuy.OpenDS; begin with UniQueryAll do begin Close; Params.ParamValues['orderinv']:=InvNum; Open; end; end; procedure TFrm_PDF_Tobuy.PrepareAndShow(Report: TfrxReport; Exp: TfrxPDFExport); var AUrl,ReportName : string; begin Report.LoadFromFile(UniServerModule.FilesFolderPath+'/pdf/test.fr3'); Report.Variables['reccount']:=UniQueryAll.RecordCount; Report.PrintOptions.ShowDialog := False; Report.ShowProgress := false; Report.EngineOptions.SilentMode := True; Report.EngineOptions.EnableThreadSafe := True; Report.EngineOptions.DestroyForms := False; Report.EngineOptions.UseGlobalDataSetList := False; ReportName := 'รายงานขอซื้อเลขที่ '+InvNum+'_'+ FormatDateTime('ddmmyy_hhmmss', Now) + '.doc'; Exp.Background := True; Exp.ShowProgress := False; Exp.ShowDialog := False; //Exp.FileName := UniServerModule.NewCacheFileUrl(False, 'doc', ReportName, '', AUrl, True); Exp.FileName := UniServerModule.NewCacheFileUrl(False, 'pdf', ReportName, '', AUrl, True); Exp.DefaultPath := ''; Report.PreviewOptions.AllowEdit := False; Report.PrepareReport; Report.Export(Exp); //UniURLFrame1.URL := AUrl; UniPDFFrame1.PdfURL := AUrl; end; procedure TFrm_PDF_Tobuy.UniButton1Click(Sender: TObject); begin Close; end; procedure TFrm_PDF_Tobuy.UniFormBeforeShow(Sender: TObject); begin OpenDS; try PrepareAndShow(frxReport1, frxPDFExport1); finally CloseDS; end; end; i baby in coding i copy from other and test to compile when you explain perhaps i don't understand but i want to save to doc i try to do but file doc not font not work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.