Jump to content

how export pdf to doc


warat mookdaanan

Recommended Posts

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

pdf.png

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...