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

rotated text breaks printing to excel

edited August 2013 in Devices
Hi,

Last year we moved to a newer delphi and reportbuilder version (Delphi
xe2, report builder 14.02)

Some of our customers reported problems printing reports to an excel
report file. These sophisticated reports, getting data from oracle and
creating charts groupings etc worked fine before. The printing to excel
also worked.

Now they get an error opening the excel file "Excel has stopped working.".

After a lot of investigating i discovered that the rotation in the
labels of the headers are responsible for this. Its easy to reproduce
with only 1 label in the report. If you give it an angle the error
occurs. If angle is set to zero i can open the file.

Is this a known bug? Is there a fix/workaround for this?

Kind Regards

Ruud

Comments

  • edited August 2013
    Ruud,

    For future posts, please configure your newsreader to post using your full
    name.

    RB 14.08 was the last produced release for RB 14.x. Check the Designer Help
    | About, if you are using a prior release, I recommend updating.

    As a work around, try setting Label AutoSize to False. In my testing, there
    is only an issue when Label AutoSize is True.

    I created a patch for RB 15 Build 2 that resolves the issue.


    Best regards,

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2013
    Hi Nard,

    thanks for the quick response.

    Is there a way to check if i am printing to excel or not?

    This way i could set autosize of the labels to false in the
    ReportBeforePrint event.

    thanks in advance

    Ruud
  • edited August 2013

    Here is an example of using the Report.BeforePrint event to determine
    whether the report is generating to XLSReport or XLSData.

    uses
    ppTypes;

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    begin

    if (ppReport1.FileDevice <> nil) then
    if (ppReport1.FileDevice.DeviceName = dtXLSReport) then
    ShowMessage('Printing to XLSReport')
    else if (ppReport1.FileDevice.DeviceName = dtXLSData) then
    ShowMessage('Printing to XLSData');


    end;


    Best regards,

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.