Thanks for those extra 2 lines of code. They made me realize that it only 
failed 
when I was setting a footer on an xls file that already had a footer. By 
removing 
the footer on skeleton xls file I was reading in, poi was able to set a new 
footer 
on the fie. 

In case anyone feels like pursuing this, I have attached the tiny skeleton file 
I was trying to set the footer on. 



----- Original Message ----- 
From: "Yegor Kozlov" <[email protected]> 
To: "POI Users List" <[email protected]> 
Sent: Monday, July 20, 2009 1:57:08 AM GMT -05:00 US/Canada Eastern 
Subject: Re: footers stopped working sometime after 3.5-beta4 

Can you please provide sample code to reproduce the problem? 

The following code works fine with 3.5-beta6 and current trunk: 

HSSFWorkbook wb = new HSSFWorkbook(); 
HSSFSheet sh = wb.createSheet(); 
HSSFFooter f = sh.getFooter(); 
f.setLeft(HSSFFooter.date()); 
f.setCenter(HSSFFooter.tab()); 
f.setRight("Page " + HSSFFooter.page() + " of " + HSSFFooter.numPages()); 

Yegor 

> Footers worked in poi version 3.5-beta4, 
> but in poi version 3.5-beta6 the following code gives the exception message: 
> bad text 'Page &P of &N' 
> 
> public static void foot (HSSFSheet sheet){ 
> HSSFFooter f = sheet.getFooter(); 
> f.setLeft(HSSFFooter.date()); 
> f.setCenter(HSSFFooter.tab()); 
> f.setRight("Page " + HSSFFooter.page() + " of " + 
> HSSFFooter.numPages()); 
> } 
> 


--------------------------------------------------------------------- 
To unsubscribe, e-mail: [email protected] 
For additional commands, e-mail: [email protected] 

Attachment: preFooted.xls
Description: application/ole-storage

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to