Shaurya
Shaurya

Reputation: 144

Apache POI A3 Page shows two pages in print preview

   sheet = workbook.createSheet(studentMarkSheetVO.getBranchName()+"_"+studentMarkSheetVO.g    etAcademicYear().split("-")[0]+"_Batch");
   sheet.getPrintSetup().setVResolution((short)300);
   sheet.getPrintSetup().setPaperSize(HSSFPrintSetup.A3_PAPERSIZE);
   sheet.getPrintSetup().setLandscape(true);
   sheet.getPrintSetup().setFitHeight((short)2000);

my page preview shows splitting of a page , in two separate pages. one has only one record and other page shown as blank with footer. I also tried :

sheet.setFitToPage(true);
PrintSetup printsetup= sheet.getPrintSetup();
printsetup.setFitHeight((short)0);
printsetup.setFitWidth((short)1);

But problem persists. any solutions....please provide your valuable suggestions. Thank you all.

Upvotes: 0

Views: 938

Answers (1)

Shaurya
Shaurya

Reputation: 144

yes answer is here i found it after spending few hours , on internet. http://poi.apache.org/spreadsheet/quick-guide.html#FitTo

Upvotes: 2

Related Questions