/** * Set whether to print in landscape * * @param ls landscape */ public void setLandscape(boolean ls) { if (ls) setOrientation(PrintOrientation.LANDSCAPE); else setOrientation(PrintOrientation.PORTRAIT); }
/** * Set no orientation. * * @param orientation Orientation. */ public void setNoOrientation(boolean orientation) { if (orientation) { setOrientation(PrintOrientation.DEFAULT); } }
/** * Set no orientation. * * @param orientation Orientation. */ public void setNoOrientation(boolean orientation) { if (orientation) { setOrientation(PrintOrientation.DEFAULT); } }
/** * Set no orientation. * * @param orientation Orientation. */ public void setNoOrientation(boolean orientation) { if (orientation) { setOrientation(PrintOrientation.DEFAULT); } }
/** * Set whether to print in landscape * * @param ls landscape */ public void setLandscape(boolean ls) { if (ls) setOrientation(PrintOrientation.LANDSCAPE); else setOrientation(PrintOrientation.PORTRAIT); }
/** * Set whether to print in landscape * * @param ls landscape */ public void setLandscape(boolean ls) { if (ls) setOrientation(PrintOrientation.LANDSCAPE); }
protected Sheet createSheet(SXSSFWorkbook wb,Paper paper,String name){ Sheet sheet = null; if(name==null){ sheet=wb.createSheet(); }else{ sheet=wb.createSheet(name); } PaperType paperType=paper.getPaperType(); XSSFPrintSetup printSetup=(XSSFPrintSetup)sheet.getPrintSetup(); Orientation orientation=paper.getOrientation(); if(orientation.equals(Orientation.landscape)){ printSetup.setOrientation(PrintOrientation.LANDSCAPE); } setupPaper(paperType, printSetup); int leftMargin=paper.getLeftMargin(); int rightMargin=paper.getRightMargin(); int topMargin=paper.getTopMargin(); int bottomMargin=paper.getBottomMargin(); sheet.setMargin(Sheet.LeftMargin, UnitUtils.pointToInche(leftMargin)); sheet.setMargin(Sheet.RightMargin, UnitUtils.pointToInche(rightMargin)); sheet.setMargin(Sheet.TopMargin, UnitUtils.pointToInche(topMargin)); sheet.setMargin(Sheet.BottomMargin, UnitUtils.pointToInche(bottomMargin)); return sheet; }
sheet.setPrintGridlines(false); XSSFPrintSetup printSetup = sheet.getPrintSetup(); printSetup.setOrientation(PrintOrientation.LANDSCAPE); sheet.setFitToPage(true); sheet.setHorizontallyCenter(true);
protected Sheet createSheet(SXSSFWorkbook wb,Paper paper,String name){ Sheet sheet = null; if(name==null){ sheet=wb.createSheet(); }else{ sheet=wb.createSheet(name); } PaperType paperType=paper.getPaperType(); XSSFPrintSetup printSetup=(XSSFPrintSetup)sheet.getPrintSetup(); Orientation orientation=paper.getOrientation(); if(orientation.equals(Orientation.landscape)){ printSetup.setOrientation(PrintOrientation.LANDSCAPE); } setupPaper(paperType, printSetup); int leftMargin=paper.getLeftMargin(); int rightMargin=paper.getRightMargin(); int topMargin=paper.getTopMargin(); int bottomMargin=paper.getBottomMargin(); sheet.setMargin(Sheet.LeftMargin, UnitUtils.pointToInche(leftMargin)); sheet.setMargin(Sheet.RightMargin, UnitUtils.pointToInche(rightMargin)); sheet.setMargin(Sheet.TopMargin, UnitUtils.pointToInche(topMargin)); sheet.setMargin(Sheet.BottomMargin, UnitUtils.pointToInche(bottomMargin)); return sheet; }