Page 1 of 1

Grouping rows

PostPosted: Thu Sep 29, 2011 6:45 pm
by MaSEL
Hi.
I try to estimate xlsx4j as a solution for our work project writing xlsx files.
How could I group rows?
I`ve used PartsList to get info the structure of the xlsx file, containing row grouping, but I got nothing similar on the console.

Re: Grouping rows

PostPosted: Thu Sep 29, 2011 7:48 pm
by MaSEL
Oh, after experiments with xlsx files structure, I`ve found the answer by myself.
It looks like that
Code: Select all
row.setOutlineLevel(outlineLevel);
should be used.
But this makes plus sign appears at the last group element, but not the first.
What should I do to fix it?

Re: Grouping rows

PostPosted: Fri Sep 30, 2011 3:44 pm
by MaSEL
The analysis of files having grouping xml should have something like
Code: Select all
<outlinePr summaryBelow="0"/>

But this works not as correct as I wish.

Re: Grouping rows

PostPosted: Mon Oct 03, 2011 6:42 pm
by MaSEL
I`ve sorted it out.
I used this code:

Code: Select all
CTSheetPr sheetPr = Context.getsmlObjectFactory().createCTSheetPr();
CTOutlinePr outlinePr = Context.getsmlObjectFactory().createCTOutlinePr();
outlinePr.setSummaryBelow(false);
sheetPr.setOutlinePr(outlinePr);
sheet.getJaxbElement().setSheetPr(sheetPr);

The problem was I set outline level incorrectly (starting from the 1, not from the 0) and got unexpected results.
Thank you for attention. :)

Re: Grouping rows

PostPosted: Tue Oct 04, 2011 12:16 am
by jason
Glad you've been able to make progress on your own; thanks very much for taking the time to report back with your solutions. I'm sure this will be helpful to others who follow. cheers .. Jason