Results 1 to 6 of 6
Thread: Excel - Print Titles - jxl
- 01-31-2011, 05:50 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 3
- Rep Power
- 0
Excel - Print Titles - jxl
Hi. This is for anybody that knows JXL. Still trying to figure out how to make setPrintTitles() work properly.
workbook = Workbook.getWorkbook(new File("output2.xls"));
WritableWorkbook workbookFinal = Workbook.createWorkbook(new File("output3.xls"), workbook);
WritableSheet sheet3 = workbookFinal.getSheet(0);
sheet3.getSettings().setPrintTitlesRow(0,1);
workbookFinal.write();
workbookFinal.close();
The very first time "output3.xls" is created, where file "output2.xls" has no Print Titles set, everything works fine. Then let's say I want to take "output3.xls" and override it. So I change the code to the following:
workbook = Workbook.getWorkbook(new File("output3.xls"));
WritableWorkbook workbookFinal = Workbook.createWorkbook(new File("output3.xls"), workbook);
WritableSheet sheet3 = workbookFinal.getSheet(0);
sheet3.getSettings().setPrintTitlesRow(0,1);
workbookFinal.write();
workbookFinal.close();
Green represents which parts I changed when I executed the code a second time. This effectively opened "output3" and wrote over it. When I tried to open the file, I got this error:
"Name cannot be the same as a built-in name.
Old name: Print_Titles
New name:"
For some reason, if Print Titles have been set in an *.xls file and a JXL code re-writes it, something in the file gets screwed up. Now mind, I know what this error is. What I'd like to know is if anybody found a way around it.
THANK YOU!!
- 06-27-2011, 10:46 AM #2
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
Hey, were you able to solve this?? I am having the exact same problem. I tried many jxl classes, like NameRecord, BuiltinName etc, but cant seem to resolve this Name Conflict issue.!
Thanks in advance.
- 07-29-2011, 07:40 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 3
- Rep Power
- 0
I did find out the solution for this but I can't remember off the top of my head. I'll reply again when I look into my documentation. Cheers!
- 07-31-2011, 09:38 AM #4
Member
- Join Date
- Jun 2011
- Posts
- 2
- Rep Power
- 0
Hey, thanx for the reply, but i found it.! something to do with the properties.!
- 09-21-2011, 08:24 AM #5
Member
- Join Date
- Sep 2011
- Posts
- 1
- Rep Power
- 0
Re: Excel - Print Titles - jxl
Hands down to you guys. This problem has been pestering me for days! I was wondering how you guys solved this?
Please guide me to the right path.
Thanks in advance!
- 05-04-2012, 04:48 PM #6
Member
- Join Date
- May 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Name titles help
By Kak75 in forum New To JavaReplies: 18Last Post: 12-19-2010, 03:01 PM -
JSP and Excel
By mohammedsiddig in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 09-25-2008, 11:03 AM -
Print the text file and print preview them
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 11:04 PM -
jsp excel
By lak in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 03-29-2008, 10:53 AM -
CSV column titles
By javaplus in forum New To JavaReplies: 2Last Post: 01-24-2008, 03:45 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks