GlobalOnCreate is not called for PDF output
Hello
I'm using Report Builder 12 and Delphi 2010
i Have a problem when generate PDF from Report Explorer.
Step :
- an empty report
- add a ShowMessage('HERE') on globalOnCreate()
If I run the code call Preview / Print / Design the message is showed, All
OK.
but if i want genere a PDF , showmessage is not called.
then... globalOnCreate is not called when i want a PDF OutPut.
and all my reports go in crash.....
my code for have PDF ( from Report Explorer button )
RB 11 CODE :
FReportExplorer.LoadReport(FListView.ItemName, FListView.FolderId);
lPDFDevice := TppPDFDevice.Create(nil);
lPDFDevice.FileName := SaveDialog.FileName;
lPDFDevice.Publisher := FReportExplorer.Designer.Report.Publisher;
FReportExplorer.Designer.Report.PrintToDevices;
RB 12 CODE :
FReportExplorer.Designer.Report.TextFileName := SaveDialog.FileName;
FReportExplorer.Designer.Report.AllowPrintToFile := True;
FReportExplorer.Designer.Report.ShowPrintDialog :=False;
FReportExplorer.Designer.Report.ShowAutoSearchDialog :=False;
FReportExplorer.Designer.Report.DefaultFileDeviceType := 'PDF';
// NEW RB 12.0
FReportExplorer.Designer.Report.DeviceType := dtPDF;
FReportExplorer.Designer.Report.PDFSettings.Title := 'Documento Planet';
FReportExplorer.Designer.Report.PDFSettings.OpenPDFFile := True;
// DON'T COMPILE
FReportExplorer.Designer.Report.PrintToDevices(FListView.ItemName,
FListView.FolderId);
// I DON'T KNOW HOW LOAD REPORT FROM REPORT EXPLORER
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5169 (20100603) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
I'm using Report Builder 12 and Delphi 2010
i Have a problem when generate PDF from Report Explorer.
Step :
- an empty report
- add a ShowMessage('HERE') on globalOnCreate()
If I run the code call Preview / Print / Design the message is showed, All
OK.
but if i want genere a PDF , showmessage is not called.
then... globalOnCreate is not called when i want a PDF OutPut.
and all my reports go in crash.....
my code for have PDF ( from Report Explorer button )
RB 11 CODE :
FReportExplorer.LoadReport(FListView.ItemName, FListView.FolderId);
lPDFDevice := TppPDFDevice.Create(nil);
lPDFDevice.FileName := SaveDialog.FileName;
lPDFDevice.Publisher := FReportExplorer.Designer.Report.Publisher;
FReportExplorer.Designer.Report.PrintToDevices;
RB 12 CODE :
FReportExplorer.Designer.Report.TextFileName := SaveDialog.FileName;
FReportExplorer.Designer.Report.AllowPrintToFile := True;
FReportExplorer.Designer.Report.ShowPrintDialog :=False;
FReportExplorer.Designer.Report.ShowAutoSearchDialog :=False;
FReportExplorer.Designer.Report.DefaultFileDeviceType := 'PDF';
// NEW RB 12.0
FReportExplorer.Designer.Report.DeviceType := dtPDF;
FReportExplorer.Designer.Report.PDFSettings.Title := 'Documento Planet';
FReportExplorer.Designer.Report.PDFSettings.OpenPDFFile := True;
// DON'T COMPILE
FReportExplorer.Designer.Report.PrintToDevices(FListView.ItemName,
FListView.FolderId);
// I DON'T KNOW HOW LOAD REPORT FROM REPORT EXPLORER
__________ Information from ESET NOD32 Antivirus, version of virus signature database 5169 (20100603) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
This discussion has been closed.
Comments
1. When making a call to PrintToDevices, you need to first call
InitializeParameters if you would like the OnGlobalCreate to fire as it does
when calling Print.
if ppReport1.InitializeParameters then
ppReport1.PrintToDevices;
2. Take a look at the following articles on loading and exporting reports
directly from the report explorer.
http://www.digital-metaphors.com/rbWiki/Design/Templates/How_To...Programmatically_Load_Reports
http://www.digital-metaphors.com/rbWiki/End-User/Report_Explorer/How_To...Add_a_PDF_button
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com