Jump to content
We've recently updated our Privacy Statement, available here ×

Problems with multi-sheet excel exporting...


r_simoni

Recommended Posts

Hi to all.

I'm upgrading jasper-reports version in use in my project from 3.1.2 to 3.7.1

During last year development I chose to use JExcel api due to an unexpected behaviour with very long report made by POI library.

Now I have this problem: my export is made by a lot of sheets. Every sheet needs a specific name.

I specify these export parameters:

  • IS_ONE_PAGE_PER_SHEET     true
  • SHEET_NAMES                                   a String[] of my sheet names
  • JASPER_PRINT_LIST                     a list of all jasper prints matching specified names

what i obtain is only the first sheet named correctly and all others named like Page <counter>.

I have tried to find a reason reading the code... maybe I'm wrong, but reading the JRXlsAbstractExporter.setParameter method code at line 347, it setup sheetNames field to a String[] with size jasperPrint.getPages().size()

Probably it is every time one (or zero) so the statement at line 417

        if (sheetNames != null && sheetIndex < sheetNames.length)
        {
            createSheet(getSheetName(sheetNames[sheetIndex]));
        }
        else
        {
            createSheet(getSheetName("Page"));
        }

 

is always false and I obtain the sheet named as Page.

Is it possibile it does not consider anymore that you could have a jasper print list? Or am I wrong and the reason is I'm specifing wrong parameters?

Thanks in advance

I have submitted this as issue:

    http://jasperforge.org/projects/jasperreports/tracker/view.php?id=4570

and there is a workaround explained.

Bye

 



Post Edited by r_simoni at 02/09/2010 15:33
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

The bug is now fixed and sources are available on the svn repo. The fix was a little bit more complicated because not only the export parameter is involved there, and actually a given report page can also be split in several sheets, depending on the maximum number of rows allowed in a sheet.

You can either browse the repository, or wait for the next release.

Thank you for your observation.

sanda

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...