poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: HSSF workbook print setup margins
Date Thu, 26 Nov 2009 07:36:23 GMT

I must admit that I would use a template file to do this because I am not
aware of any technique that will allow you to insert pictures into the
footer using POI. Simply create a new Workbook using Excel, set the margins
as you want them and save it away. All you need to do then is open the
workbook using POI and populate the sheet(s).

Just a word of warning - possibly - pictures in headers and footers were not
supported in versions prior to 2002 - I think. Before that time, you have to
use a trick to fool Excel into placing the image into a hearder/footer and
so you risk creating files that may not - and I emphasise the may bit - be
completely compatible with older versions (e.g. Excel 97/2000) of Excel.


Mark B

JochenP wrote:
> Hello,
> I currently trying to figure out if it is possible to set the margins of a
> workbook or excel document.
> I know there are two methods to set the footer margin and header margin on
> the PrintSetup class, on every sheet, but these don't seem to help. 
> What I need to do is reduce the top, right, bottom and left margin to it's
> minimum, so more content can be printed on one page. 
> I also tried the the autobreaks and fit-width 1, but then I don't have
> control over the paging which I need.
> One thing I also would like to know: Is it possible to add pictures to the
> footers? 
> Or is there an other way, to start from a template excel file and dump my
> data in a new copy of the template? Has anyone had experience with this?
> Kind regards,
> Jochen Punie

View this message in context: http://old.nabble.com/HSSF-workbook-print-setup-margins-tp26513632p26525252.html
Sent from the POI - User mailing list archive at Nabble.com.

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

View raw message