Bug 55378

Summary: Need to setup Print option "Fit All Columns on One Page" in poi java code
Product: POI Reporter: Rajesh <rajeshkonduru>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: major CC: ramandeep21119
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

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