Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

qrdesign delphi 5 pdf

Posted on 2014-03-28
5
Medium Priority
?
518 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Sometimes Administrators rights are not enough. These cases call for the SYSTEM account. The process in this article outlines the steps required to execute commands using the SYSTEM account.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

604 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