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

Creating a .xls file with multiple worksheets


mfirkser

Recommended Posts

 I'm creating a report with an xls output.  I would like to create a second worksheet to list the parameters the user passes.  If I put it on the same worksheet, it messes with the cell alignments.  Does anybody have any ideas on how to do this?

Thanks in advance.

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

There are a couple of things you could do. Here's a link to a good example of how to make sure that the cells line up properly: http://fecplanner.com/jasperreports/docs/tips.tricks.html#friendly

 

Or if you still want to put the parameters on a second sheet, Go to Tools/Options menu, Export Options tab, and click on Excel. In the main area, you can make sure to check "One page per sheet" and then put a page break before your parameters. Let me know if this doesn't solve your issue.

 

Link to comment
Share on other sites

I put a page break at the top of the summary, but for some reason, the summary appears at the beginning of the report, and I see no page breaks.

I can make cells line up properly, but the number of columns vary by report.

Link to comment
Share on other sites

Because it is designed to have .xls output, I have ignore pagination checked.  When I uncheck it, and have the page break, the parameters show up at the end, but every new page is a new tab.

Something else that may be a wrench in the works is that the report is two crosstabs, so all the data is being displayed is in the summary, and I tack on the parameters after that.

Below is the jrxml.

Thanks.

Code:


Post Edited by mfirkser at 07/19/2011 07:13 AM
Link to comment
Share on other sites

I see subreports below the parameters - do you want those to be on the same sheet as the parameters or on a different sheet or on the same sheet as the crosstabs? If you want the subreports on the same page as the parameters, then don't change anything. If you want the subreports on the same page as the crosstabs, then move them above the page break. If you want them on a new sheet, then add another page break.

 

For getting the parameters on a different page, change the page break property "Position Type" to "Float" and then check the following:

Tools menu -> Options -> Export Options tab -> highlight Excel in left pane -> make sure "One Page per Sheet" is checked

I believe the Position Type will make sure to keep the page break after the crosstabs and the One Page per Sheet will keep everything on One sheet surrounding the hard coded page breaks you've inserted.

 

HTH

Link to comment
Share on other sites

The subreports are part of the parameters.  I put the page break in with "Float" for position, and it sort of works right.  The parameters are on a different page, but then a portion of the parameters page is also put on the page with the rest of the data.

I think I'll just put all the stuff on one page.  If I wanted all this aggravation, I would stick with Crystal. 

Link to comment
Share on other sites

 I set the float, but some of the stuff in parameters appears twice in the final report if I have the page break in there.  Trying different placements in the order (bring to front, bring to back).  Maybe just a quirk in there.

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...