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

Print To File and Bands

edited June 2005 in General
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?

Comments

  • edited June 2005
    Hi Preston,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    When I print to file or the printer the device type is the same. Is there a
    different flag that's avialble?

  • edited June 2005
    > When I print to file or the printer the device type is the same. Is there

    what does your code look like?

    Ed Dressel
    Team DM
  • edited June 2005
    Preston,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    Ok,

    I'll give that a shot. I was using the Report.DeviceType

    Preston


  • edited June 2005
    Nico,

    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;

This discussion has been closed.