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

Export with TppXLSDataDevice and DefaultBands

edited November 2013 in Devices
Hello,

We are using 2 ways to export a report to an XLS file:

1. By code where an instance of TppXLSDataDevice is created and used for
the output

2. Using the standard print dialog aund the user selects the file format
manually

For the first case we can set TppXLSDataDevice.DefaultBands to define
which bands should be written to the output. Thats fine.

In the second case the user selects the format but the undelying code
has no access to the actual instace of the device that performs the
output. So there is no way to set things like "DefaultBands" before the
export is done.

I read in the help that the property "Band.Save" and the "Save" property
of all components inside that band has to be set to true in order so
save a specific band to the file.

That works so far but a *lot* of reports have to be edited to set all
those "Save" properties. That is a lot of work for older reports and for
new reports the designer of the report has to remember to do that on the
new reports.

Is there a way to define "DefaultBands" when an export is done using the
print dialog?

Tbaks in advance,
Ralf

Comments

  • edited November 2013

    You can implement the Report.OnFileDeviceCreate event to set the
    DefaultBands property.

    Example:

    uses
    ppTypes,
    ppXlsDevice;


    if ppReport1.FileDevice is TppXlsDataDevice then
    TppXlsDataDevice(ppReport1.FileDevice).DefaultBands := [btDetail];



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2013
    Am 07.11.2013 16:56, schrieb Nard Moseley (Digital Metaphors):

    Hi Nard,

    Thanks! I think that will solve my problem.

    Ciao,
    Ralf
This discussion has been closed.