Solved

qrdesign delphi 5 pdf

Posted on 2014-03-28
5
433 Views
Last Modified: 2014-11-27
I have an old program in delphi 5. The reports are made with qrdesign and although I can preview them and then manually save them as a pdf, I would like to have a code that directly creates a pdf file from the report without making the user have to type anything at all.
0
Comment
Question by:ggfso
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39962016
Are you wanting to programmatically control qrdesign or write your own PDF creation routine?

mlmcc
0
 

Author Comment

by:ggfso
ID: 39962588
At the moment I am clicking a button which which calls ReportDesignerDialog1.printreport(ExtractFilePath(ParamStr(0))+'form1.QR2'); This gives me a preview of the form1.qr2, I can manually save that preview as a pdf or print it to a virtual pdf printer.

What I would like is that button to create and save the pdf file without asking me anything at all. I would give it the path and the file name as parameters and the pdf file would be saved in the given folder with the given name.
0
 
LVL 9

Accepted Solution

by:
rinfo earned 500 total points
ID: 39963390
Dont just call ReportDesigerDialog.
All report designer have a method to print it directly with out preview.
This is an example by quickreport to export report to pdf  and excel.
You can surely use this
procedure TForm9.Button3Click(Sender: TObject);
begin
  // Export report to a PDF document
  gtPDFEngine1.FileName := 'eDoc_Quickreport_Demo.pdf';
  gtPDFEngine1.Preferences.ShowSetupDialog := false;
  gtQRExportInterface1.Engine := gtPDFEngine1;
  gtQRExportInterface1.RenderDocument(QRPQuickrep1, false);

  // Export report to a Excel workbook
  gtExcelEngine1.FileName := 'eDoc_Quickreport_Demo.xls';
  gtExcelEngine1.Preferences.ShowSetupDialog := false;
  gtQRExportInterface2.Engine := gtExcelEngine1;
  gtQRExportInterface2.RenderDocument(QRPQuickrep1, false);
end;

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Determine Drive Types 2 473
Delphi TClientDataSet - override Refresh event 4 757
How to capture screen window of a process 4 398
SHBrowseForFolder - Preselecting a folder 5 256
In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now