Printing page ranges using ExtraDevices
Hi all,
I have a report that is created at run-time (not an end-user report). There
is a button on the preview form to mass mail the pages of the report to
their respective addresses. What I need to do is traverse the report and
save the corresponding pages to a .pdf and then e-mail that as an
attachment. I have all of the logic worked out already, but I'm having a
problem specifying which pages to save to pdf. Ie. page 1 & 2 go to somebody
at somewhere.com, how can I tell the report to print just pages 1 & 2 w/o
using the print dialog?
I have a report that is created at run-time (not an end-user report). There
is a button on the preview form to mass mail the pages of the report to
their respective addresses. What I need to do is traverse the report and
save the corresponding pages to a .pdf and then e-mail that as an
attachment. I have all of the logic worked out already, but I'm having a
problem specifying which pages to save to pdf. Ie. page 1 & 2 go to somebody
at somewhere.com, how can I tell the report to print just pages 1 & 2 w/o
using the print dialog?
This discussion has been closed.
Comments
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
What am I missing?
TppProducer(Report).AllowPrintToFile := True;
TppProducer(Report).TextFileName :=
ExtractFilePath(Application.ExeName)+'\DATA\REPORT.PDF';
TppProducer(Report).DeviceType := 'PDFFile';
TppProducer(Report).ShowPrintDialog := False;
TppProducer(Report).FileDevice.PageSetting := psPageList; // AV Here
*******
// I switched the above line from PrinterDevice to FileDevice thinking
that would be correct, but I am still getting and AV
{note: this is a useful routine for converting the page list text
to the list of strings}
{print pages 1 and 3 }
ppTextToPageList('1,3', TppProducer(Report).FileDevice.PageList, True);
TppProducer(Report).Print;
'beforeprint'...so, naturally it would cause an AV.
Note, in your code you do /not/ need to typecast Report as TppProducer.
(TppProducer is the ancestor of Report, ArchiveReader, and the ClientReport
included with RB Server Edition.)
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com