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

XLS export and page breaks

edited April 2013 in Devices
I migrated my system from RB 10 + XtraDevices to RB 14 (no ExtraDevices).

With ExtraDevices, when I exported a report with the footer.visible =
false and header.visible = false, the generated excel spreadsheet had
continous lines.

RB 14 seems to insert blank lines where the footer/header would be (but
there shouldn't be anything there, since they are not visible), causing
problems to customers who uses filters in excel.

I also tried to set all four margins to zero... it helped, but blank
lines are still being inserted.

What can be done to solve this problem?

PS: I cant use XLS Data File since it doesnt export the report title,
and customer needs it.

Carlos

Comments

  • edited April 2013

    For XLSData the File | Print To File setup dialog can be used to specify
    which bands and components to export. Or via code set the Band.Save and
    Component.Save properties. (The default behavior is that the detail elements
    are exported.)

    Check out the RBuilder help topics for TppXLSReportDevice and
    TppXLSDataDevice for details on these formats.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2013
    Nard, I tried to set the components to export and use the XLSData, but
    found that the default behavior is to export the coluns in
    "alphabetical" order (based on the components names).

    This is a very big tabular report with more than 100 columns (it was
    made to be exported, not to be seen on the screen) and changing manually
    the order of the exported components will take a lot of time. Isn't
    there a way to make it export respecting the currently layout of the
    components in the report?

    Carlos

    Em 22/04/2013 11:33, Nard Moseley (Digital Metaphors) escreveu:
  • edited May 2013
    When Band.Save is true, you must set the Component.Save and SaveNo
    properties. The default SaveNo defines the save number (order). The default
    is Z-Order, which is the Index of the component in the Band.Objects[ ]
    array. This behavior has been in the product since the beginning.

    Another option I forgot about is to use XLSDataDevice.DefaultBands property
    to modify the default behavior of exporting only the detail band. Then you
    don't have to use the Print To File Setup dialog to do anything and the
    default order is left to right positing in the layout. Here is an example
    that implements the Report OnFileDeviceCreate event..

    uses
    ppTypes,
    ppXLSDevice;

    procedure TForm7.ppReport1FileDeviceCreate(Sender: TObject);
    begin

    if ppReport1.FileDevice is TppXLSDataDevice then
    TppXLSDataDevice(ppReport1.FileDevice).DefaultBands := [btDetail,
    btTitle];

    end;




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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2013
    Thanks Nard! Your new sugestion is much better than the old one ;)

    Anyway, would it be too dificult for you to create a new property in the
    XLSSettings to set what bands should be exported? I think this would be
    very useful to everyone.

    Carlos

    Em 13/05/2013 16:31, Nard Moseley (Digital Metaphors) escreveu:
  • edited May 2013
    I added this to the requested feature list.


    Thanks for the feedback.

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2013
    +1 from me.

    Jason.

This discussion has been closed.