I have a footer band that shows the page number. When printing to file (excel) I don't want the footer band to print because there are no pages. I don't see a property to set this. How are other people doing this?
Inside the Report.BeforePrint event, you can check to see which device your user is printing to then based on that information set the visible property of the footer band to False.
Where are you trying to retrieve the device type? If you are printing from the print dialog to Excel, you need to use the Report.PrintDialog.DeviceType property to find this information.
I work with Preston. Your suggestion worked (see below). Thanks!
procedure TBaseRpt.ppBaseRptBeforePrint(Sender: TObject); begin if (ppBaseRpt.DeviceType = dtPrinter) and (ppBaseRpt.PrintDialog.DeviceType = 'Excel Document') then begin ppFooterBand1.Visible:=false; end; end;
procedure TBaseRpt.ppBaseRptStartPage(Sender: TObject); begin if (ppBaseRpt.DeviceType = dtPrinter) and (ppBaseRpt.PrintDialog.DeviceType = 'Excel Document') and (ppBaseRpt.Page > 1) then begin ppHeaderBand1.Visible:=false; end; end;
Comments
Inside the Report.BeforePrint event, you can check to see which device your
user is printing to then based on that information set the visible property
of the footer band to False.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
different flag that's avialble?
what does your code look like?
Ed Dressel
Team DM
Where are you trying to retrieve the device type? If you are printing from
the print dialog to Excel, you need to use the Report.PrintDialog.DeviceType
property to find this information.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I'll give that a shot. I was using the Report.DeviceType
Preston
I work with Preston. Your suggestion worked (see below). Thanks!
procedure TBaseRpt.ppBaseRptBeforePrint(Sender: TObject);
begin
if (ppBaseRpt.DeviceType = dtPrinter) and
(ppBaseRpt.PrintDialog.DeviceType = 'Excel Document') then begin
ppFooterBand1.Visible:=false;
end;
end;
procedure TBaseRpt.ppBaseRptStartPage(Sender: TObject);
begin
if (ppBaseRpt.DeviceType = dtPrinter) and
(ppBaseRpt.PrintDialog.DeviceType = 'Excel Document') and
(ppBaseRpt.Page > 1) then begin
ppHeaderBand1.Visible:=false;
end;
end;