Solved

qrdesign delphi 5 pdf

Posted on 2014-03-28
5
414 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

17 Experts available now in Live!

Get 1:1 Help Now