Yeah, or you can look in the quick guide, which is where I send everyone who asks this question and doesn't know that the autobreaks have to be set (which caused me some problems when I first wrote it -- hence the quick guide entry).
Shawn -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 7:00 AM To: [email protected] Subject: Re: Excel Sheet - Page Setup trouble ('fit to 1 page wide'). Hopefully Shawn who wrote that part will give you a more intelligent answer (Don't ask me, I just work here :-) )...but until then I might suggest you take one of your own sheets, unfitted, look at the print setup/etc with HSSF. Fit it with Excel, look at the print setup with HSSF and compare. If I had to guess I'd say you need both fit width and fit height. It could also be that you have blank records on columns that go on the next page. -Andy [EMAIL PROTECTED] wrote: > Hello. > > I am having a little trouble generating an XLS file using HPSSF, with the printing format to be more specific. > The Sheet involved contains a large number of columns, which print on two pages wide if I try to print them at 100% scale. > In this case, I usually use the 'Fit to <1> page (s) wide by < > page(s) tall' option in the Excel 'Page Setup' dialog. > Since other users, who don't know the 'fit to page' tip, will use the generated files, I would like to fix this while generating the sheet in my java code, but unfortunately it doesn't seem to work. > > Here is what I do: > - set the page format (A4) on the sheet > - set the page layout (Horizontal) on the sheet > - set the page margins on the sheet > - create my data rows and columns, and format them > - try to set the 'fit to' by using: > sheet.getPrintSetup().setFitWidth((short) 1); > - save the file. > > Unfortunately, this doesn't seem to be the right way to do it, because when I open the created file and print it, the page prints on 2 pages wide... > > Does anyone have an idea...? Am I missing something here? Or doesn't this option work...? > > Thanks a lot, > > Fr?d?ric Ferrant > > > __________ > Disclaimer: This e-mail is intended for the exclusive use by the > person(s) mentioned as recipient(s). This e-mail and its attachments, > if any, contain confidential information and/or information protected > by intellectual property rights or other rights. This e-mail > does not constitute any commitment for ING or its subsidiaries except when > expressly otherwise agreed in a written agreement between the > intended recipient and the originating subsidiaries of ING, sender of > the mail. > If you receive this message by mistake, please, notify the sender > with the "reply" option and delete immediately this e-mail > from your system, and destroy all copies of it. You may not, directly > or indirectly, use, disclose, distribute, print or copy, this e-mail > or any part of it if you are not the intended recipient. > You have to take at any time all necessary measures against viruses. -- Andrew C. Oliver SuperLink Software, Inc. Java to Excel using POI http://www.superlinksoftware.com/services/poi Commercial support including features added/implemented, bugs fixed. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
