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

Export to Excel, missing header band

edited November 2011 in General
Hi

I Have a problem when exporting to XLSData device. I want the header
band also exported. I thought it should be done like this:
MyReport.Defaultbands := MyReport.Defaultbands + [btHeader];
MyReport.Print;

But I still get only the detailband in my excel file. Obviously I'm
doing something wrong

--
Arno

Comments

  • edited November 2011
    Arno Verhoeven wrote:


    And as usual I forgot: Delphi XE, ReportBuilder 12.05 build 251,
    Windows Xp sp3

    --
    Arno
  • edited November 2011
    Report.DefaultBands specifies which bands are created for new layouts. For
    example, when you call Report.Template.New to create a new layout.

    I think you are referring to the XLSDataDevice.DefaultBands property. :) Try
    using the Report.OnFileDeviceCreate event to typecast Report.FileDevice as
    XLSDataDevice.

    example:

    uses
    ppXLSDevice;

    if (Report.FileDevice is TppXLSDataDevice) then
    TppXLSDataDevice(Report.FileDevice).DefaultBands := ...


    An alternative approach is use the File | Print To File setup dialog to
    specify
    which bands and elements to export. Another option is to set the Band.Save
    and Component.Save properties to True.

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2011
    Nard Moseley (Digital Metaphors) wrote:


    Thanks Nard, got it working

    --
    Arno
This discussion has been closed.