Export Report to Excel over more than 1 sheet

bernajacbernajac Member Posts: 20
I am currently looking at Report 120 - Aged Accounts Receivable which exports data to excel using the Excel Buffer functionality in NAV. My client has problems with report because they are exporting more than 65536 lines. I know that Office 2007 has increased this number to 1048576 but they don't have any plans to upgrade at the time. Does anyone know how to force the report to create new sheet and start writing to the next sheet if record count reaches 65500 lines? I tried to use the CreateSheet() but does not work.

Comments

  • BeliasBelias Member Posts: 2,998
    The counter is simple, i think you can easily calculate the line number.
    You can't use excel buffer for this operation, so you need to use the automation...anyway...
        CREATE(XlApp,TRUE);
        XlApp.Visible(FALSE);
        XlWorkBook := XlApp.Workbooks.Add;
        XlWorkSheet := XlWorkBook.Worksheets.Add;
        XlWorkSheet.Name := 'BuBu';
        XlWorkSheet := XlWorkBook.Worksheets.Add;
        XlWorkSheet.Name := 'BaBa';
    
    to add sheets...
    then select them with...
        XlWorkSheet := XlWorkBook.Worksheets.Item('BuBu');
        XlWorkSheet.Select;
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.