[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: footers stopped working sometime after 3.5-beta4 [SOLVED]
From:       everymoment () comcast ! net
Date:       2009-07-25 21:35:42
Message-ID: 496877615.5511331248557742797.JavaMail.root () sz0100a ! westchester ! pa ! mail ! comcast ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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" <yegor@dinom.ru> 
To: "POI Users List" <user@poi.apache.org> 
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: user-unsubscribe@poi.apache.org 
For additional commands, e-mail: user-help@poi.apache.org 


[Attachment #5 (text/html)]

<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div \
style='font-family: Arial; font-size: 12pt; color: #000000'>Thanks for those extra 2 \
lines of code. They made me realize that it only failed<br>when I was setting a \
footer on an xls file that already had a footer. By removing<br>the footer on \
skeleton xls file I was reading in, poi was able to set a new footer<br>on the fie. \
<br><br>In case anyone feels like pursuing this, I have attached the tiny skeleton \
file<br>I was trying to set the footer on.<br><br><br><br>----- Original Message \
-----<br>From: "Yegor Kozlov" &lt;yegor@dinom.ru&gt;<br>To: "POI Users List" \
&lt;user@poi.apache.org&gt;<br>Sent: Monday, July 20, 2009 1:57:08 AM GMT -05:00 \
US/Canada Eastern<br>Subject: Re: footers stopped working sometime after \
3.5-beta4<br><br>Can you please provide sample code to reproduce the \
problem?<br><br>The following code works fine with 3.5-beta6 and current \
trunk:<br><br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; HSSFWorkbook wb = new \
HSSFWorkbook();<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; HSSFSheet sh = \
wb.createSheet();<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; HSSFFooter f = \
sh.getFooter();<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; \
f.setLeft(HSSFFooter.date());<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; \
f.setCenter(HSSFFooter.tab());<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; f.setRight("Page \
" + HSSFFooter.page() + " of " + HSSFFooter.numPages());<br><br>Yegor<br><br>&gt; \
Footers worked in poi version 3.5-beta4,<br>&gt; but in poi version 3.5-beta6 the \
following code gives the exception message:<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; bad text 'Page &amp;P of &amp;N'<br>&gt; <br>&gt; public static void \
foot (HSSFSheet sheet){<br>&gt; &nbsp; &nbsp; &nbsp;HSSFFooter f = \
sheet.getFooter();<br>&gt; &nbsp; &nbsp; &nbsp;f.setLeft(HSSFFooter.date());<br>&gt; \
&nbsp; &nbsp; &nbsp;f.setCenter(HSSFFooter.tab());<br>&gt; &nbsp; &nbsp; \
&nbsp;f.setRight("Page " + HSSFFooter.page() + " of " + <br>&gt; \
HSSFFooter.numPages());<br>&gt; } <br>&gt; \
<br><br><br>---------------------------------------------------------------------<br>To \
unsubscribe, e-mail: user-unsubscribe@poi.apache.org<br>For additional commands, \
e-mail: user-help@poi.apache.org<br><br></div></body></html>


["preFooted.xls" (application/x-ole-storage)]

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic