My Oracle Support Banner

Exporting to Excel Output Format Throws ArrayIndexOutOfBoundsException When There Are More Data Columns Than Defined in the Header (Doc ID 2900322.1)

Last updated on OCTOBER 10, 2022

Applies to:

BI Publisher (formerly XML Publisher) - Version 12.2 and later
Information in this document applies to any platform.


When using template/data combination that can generate more number of data columns than columns defined in table header, XLSX output throws ArrayIndexOutOfBoundsException. The same error won't be seen for other output types like PDF and HTML.


  1. Create an RTF template which has a simple Word table with 2 rows and 46 columns. The first row will be used for the header and the second row will be populated dynamically based on loops.
  2. Add 46 columns for the header row. No programming is used for the header row.
  3. In the first column of the second row, enter a for-each-group loop.
  4. In a different column of the same row, enter another for-each-group loop.
  5. In the last column of the same row, end both for-each-group loops.
  6. Create a report based on the RTF template created above and using an XML Data with information that will require the second for-each-group to run more than once. This will add additional columns for some rows.
  7. Run the report.
  8. Export the report to HTML, PDF, PPT.
  9. Verify the report is generated successfully.
  10. Export the report to Excel.
  11. Verify the java.lang.ArrayIndexOutOfBoundsException: 46 >= 46 occurs.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.