Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Letterhead paper problem

edited August 2011 in Devices
Dear all,

I have put letterhead paper in the Pagestyle of reports so that
when a .pdf is produced the letterhead is included. This works
fine.

However, when previewing the report locally and printing it the
report should not print the background on paper since there is
allready letterhead paper available in the printer bin.

The following code is used in two events (ReportBeforePrint,
ReportOnStartPage):

<-start-->
if (Report.PrinterDevice <> nil) and (Report.FileDevice = nil) then
PageStyle.Visible := False
else
PageStyle.Visible := True;

Report.EmailSettings.Recipients.Add(ORDERS['D_EMAIL']);
Report.EmailSettings.Subject:= ('Factuur'+' '+ORDERS['INVOICEID']);

<-end-->

I am using RB 12.05, Delphi2010, Firebird 2.5.

Somewhere I am missing the point but where?

Kind regards,

Jerri

Comments

  • edited August 2011
    Hi Jerri,

    My guess is that in some cases, even though you are printing to the
    printer, the file device is not nil. Try tracing this code and see if
    that is the case. You may want to simply remove that part of the
    condition from your code.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.