Solved

qrdesign delphi 5 pdf

Posted on 2014-03-28
5
482 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 101

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

We take a look at some of the most common obstacles that IT teams run into as they work relentlessly to keep all the alarms and sirens from going off at once.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

717 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