How to use jxl open file turn off gridlines and save
Posted
by
sally
on Stack Overflow
See other posts from Stack Overflow
or by sally
Published on 2012-11-13T22:30:52Z
Indexed on
2012/11/13
23:00 UTC
Read the original article
Hit count: 941
I am new to jxl, but I have what I think is a pretty simple requirement. I want to take an existing .xls file with three tabs, turn off the gridlines on all 3, and then save it again. It looks from the API like there is a function to handle gridlines setPrintGridLines(boolean b)
I would love it if someone could give me sample code - or a link pointing me in the right direction - on how to do this.
Thank you in advance
Here is what I've tried (bear with me, like I said I'm brand new to jxl)
WorkbookSettings ws = new WorkbookSettings();
WritableWorkbook workbook = Workbook.createWorkbook(new File(xlsFile), ws);
WritableSheet[] w = workbook.getSheets();
for ( WritableSheet sheet : w ) {
sheet.getSettings().setPrintGridLines(false);
}
workbook.write();
workbook.close();
I get the error Could not generate XLS. Index: 0, Size: 0
but I may be totally off base in what I am trying
© Stack Overflow or respective owner