er, maxCellsThisSheet is initialized to zero, then gets incremented AFTER the for() loop if the number of cells this row is greater. This loop also only gets used in that case. I realized after I sent it that that might look a little odd out of context. :)
On Fri, 2008-12-12 at 18:08 -0500, Ethan Baldridge wrote:
> Hello,
>
> I'm having some issues. I'm trying to simply take input files which are
> existing XLS or XLSX files and unhide everything.
>
> Unhiding sheets works fine, but this block of code:
>
> for (int col = maxCellsThisSheet; col < cellsThisRow; col++)
> {
> wb.getSheetAt(i).setColumnHidden(col, false);
> //wb.getSheetAt(i).setColumnGroupCollapsed((int)col, false);
> }
> (i is the current value in a loop from 0 to wb.getNumberOfSheets())
>
> is having some issues. Instead of unhiding columns, it makes all columns
> hidden (and setColumnHidden(col,true) instead of false still has the
> same effect) and if I uncomment the setColumnGroupCollapsed line, Excel
> won't load the output, saying the sheet is corrupt. Could somebody tell
> me what I'm doing wrong?
>
> Thanks,
--
Ethan Baldridge <[email protected]>
Superior Document Services
signature.asc
Description: This is a digitally signed message part
