Bug 55378 - Need to setup Print option "Fit All Columns on One Page" in poi java code
Summary: Need to setup Print option "Fit All Columns on One Page" in poi java code
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.7-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-07 11:03 UTC by Rajesh
Modified: 2016-05-13 14:41 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rajesh 2013-08-07 11:03:14 UTC
Hi all,

I know that following poi code will setup the print option "Fit Sheet on One Page" by default
    Workbook wb = new HSSFWorkbook();
    Sheet sheet = wb.createSheet("format sheet");
    PrintSetup ps = sheet.getPrintSetup();

    sheet.setAutobreaks(true);
    ps.setFitHeight((short)1);
    ps.setFitWidth((short)1);

But my requirement is to setup Print Option "Fit All Columns on One Page" by default. i.e. when the excel is generated and user presses Ctrl+P it should show the Print dialog box with "Fit All Columns on One Page" option by default.
I tried with 
    ps.setFitHeight((short)2);
    ps.setFitWidth((short)2);
but it doesn't work. 

Can somebody please help asap, need help urgently.

Thanks,
Rajesh
Comment 1 Nick Burch 2013-08-07 11:15:23 UTC
Bugzilla is a place to report issues with the project and contribute fixes, not to ask for support. For help, you need to post to the user mailing list - http://poi.apache.org/mailinglists.html