Hi Nico, thanks for your help. I founded your tip in other topic a few minutes before your answer. I tested, but my intention is save with .pdf files this report. My objective is export to pdf file the first and last page by the report. In my tests don't work because this process is only runtime, without user choice.
Procedure TForm1.rptTesteBeforePrint(Sender: TObject); Begin If (rptTeste.PrinterDevice <> Nil) Then Begin rptTeste.PrinterDevice.PageSetting := psPageList;
//Print only first page ppTextToPageList('1', rptTeste.PrinterDevice.PageList, True); End;
Only complement the before message. Same setting page interval, export all pages of the report.
Regarts,
Eliseu Corrona.
"Eliseu Corrona" escreveu na notícia da mensagem:515d840b$1@mail....
Hi Nico, thanks for your help. I founded your tip in other topic a few minutes before your answer. I tested, but my intention is save with .pdf files this report. My objective is export to pdf file the first and last page by the report. In my tests don't work because this process is only runtime, without user choice.
Procedure TForm1.rptTesteBeforePrint(Sender: TObject); Begin If (rptTeste.PrinterDevice <> Nil) Then Begin rptTeste.PrinterDevice.PageSetting := psPageList;
//Print only first page ppTextToPageList('1', rptTeste.PrinterDevice.PageList, True); End;
Thanks Nico. Work perfectly. Sorry about this doubt, I don't know there was this differentiation. I thought everything was based on PrintDevice because it was treated as an impression.
Comments
Take a look at demo 124 of the main reports demo. It shows how to print
specific pages using the BeforePrint Event and the ppTextToPageList routine.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I founded your tip in other topic a few minutes before your answer. I
tested, but my intention is save with .pdf files this report.
My objective is export to pdf file the first and last page by the report.
In my tests don't work because this process is only runtime, without user
choice.
Example of my code:
Procedure TForm1.BtnExportToPDFClick(Sender: TObject);
Begin
rptTeste.DeviceType := 'PDF';
rptTeste.ShowPrintDialog := False;
rptTeste.ShowCancelDialog := False;
rptTeste.TextFileName := 'Pagina1.pdf';
rptTeste.Print;
End;
Procedure TForm1.rptTesteBeforePrint(Sender: TObject);
Begin
If (rptTeste.PrinterDevice <> Nil) Then
Begin
rptTeste.PrinterDevice.PageSetting := psPageList;
//Print only first page
ppTextToPageList('1', rptTeste.PrinterDevice.PageList, True);
End;
End;
Is there anything I can improve?
Regarts,
Eliseu Corrona.
Same setting page interval, export all pages of the report.
Regarts,
Eliseu Corrona.
"Eliseu Corrona" escreveu na notícia da mensagem:515d840b$1@mail....
Hi Nico, thanks for your help.
I founded your tip in other topic a few minutes before your answer. I
tested, but my intention is save with .pdf files this report.
My objective is export to pdf file the first and last page by the report.
In my tests don't work because this process is only runtime, without user
choice.
Example of my code:
Procedure TForm1.BtnExportToPDFClick(Sender: TObject);
Begin
rptTeste.DeviceType := 'PDF';
rptTeste.ShowPrintDialog := False;
rptTeste.ShowCancelDialog := False;
rptTeste.TextFileName := 'Pagina1.pdf';
rptTeste.Print;
End;
Procedure TForm1.rptTesteBeforePrint(Sender: TObject);
Begin
If (rptTeste.PrinterDevice <> Nil) Then
Begin
rptTeste.PrinterDevice.PageSetting := psPageList;
//Print only first page
ppTextToPageList('1', rptTeste.PrinterDevice.PageList, True);
End;
End;
Is there anything I can improve?
Regarts,
Eliseu Corrona.
You will want to swap out for Report.FileDevice is you want this effect
when exporting to file.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Work perfectly.
Sorry about this doubt, I don't know there was this differentiation.
I thought everything was based on PrintDevice because it was treated as an
impression.
Thank you again.
Regarts,
Eliseu Corrona.