Home Devices
New Blog Post: Email: Multi-Service

XlsxData empty excel file

Hi All

I'm having problems exporting to excel using the code below. I would expect a few hundred lines. The previow and print are fine. The resulting file is 0 bytes. It does work on one PC with a much older version of excel 2007. On my usualy PC its V19. None of my clients PC's work either.
Any suggestions, anyone has the same ?
Thanks, Andy
fmMain.ppReport1.AllowPrintToFile := True;
fmMain.ppReport1.DeviceType := dtXlsxData;
fmMain.ppReport1.TextFileName := 'C:\Temp\myXlsxReportData.xlsx';
fmMain.ppReport1.Print;

Comments

  • Sometimes I get listindex out of bounds (1) but only on a different PC
  • If I don't check - Open File it works ok. Thats fine, I can open the file in code after.
  • Hi Andy,

    By default XlsxData only exports detail band elements. Use the Print To File Setup dialog to specify which bands and elements to export. For each subreport, access the workspace for the child report and then use Print To File Setup dialog from there.

    The above may be causing empty file to be exported.

    RB does not use Excel to perform the export. (Excel version is not relevant)

    No known issues of list index out of bounds or open file feature. If you would like to create a simple example project that demonstrates the issue(s) we can run it in the debugger and research it.





    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • Hi Nard
    I was only using details and header. It was simply the Open checkbox that was causing it.
Sign In or Register to comment.