コード例 #1
0
 private void buildFooter() {
   if (bean.getReportLayout().getPageFooterBand().getColumnCount() == 0) {
     return;
   }
   try {
     printPageFooterBand();
     Footer footer = xlsSheet.getFooter();
     footer.setCenter(footerS.toString());
   } catch (QueryException ex) {
     ex.printStackTrace();
   } finally {
     footerS = new StringBuilder();
   }
 }
コード例 #2
0
  protected void newPage() {
    addRegions(xlsSheet, regions, wb);
    if (hasTemplate()) {
      xlsSheet = wb.getSheetAt(bean.getReportLayout().getTemplateSheet() - 1);
    } else {
      // for a group name inside sheet name when we create a page we do not have the group name yet
      // so we will have to set the name of the previous sheet (see also finishExport where we set
      // the name of the last sheet(s)
      String sheetName = replaceSheetNameParam(bean.getReportLayout().getSheetNames());
      if ((sheetName == null) || sheetName.isEmpty()) {
        sheetName = String.valueOf(page);
      }
      if (sheetNameContainsGroup(bean.getReportLayout().getSheetNames()) && (page > 1)) {
        // current group is for previous sheet page
        xlsSheet = wb.createSheet(String.valueOf(page));
        wb.setSheetName(page - 2, sheetName);
      } else {
        xlsSheet = wb.createSheet(sheetName);
      }
    }
    xlsSheet.setMargin(
        Sheet.LeftMargin, getInches(bean.getReportLayout().getPagePadding().getLeft()));
    xlsSheet.setMargin(
        Sheet.RightMargin, getInches(bean.getReportLayout().getPagePadding().getRight()));
    xlsSheet.setMargin(
        Sheet.TopMargin, getInches(bean.getReportLayout().getPagePadding().getTop()));
    xlsSheet.setMargin(
        Sheet.BottomMargin, getInches(bean.getReportLayout().getPagePadding().getBottom()));

    if (bean.getReportLayout().getOrientation() == LANDSCAPE) {
      xlsSheet.getPrintSetup().setLandscape(true);
    }

    setPaperSize();

    patriarch = xlsSheet.createDrawingPatriarch();
    buildHeader();
    buildFooter();
    page++;
    // first page header is written by ResultExporter
    if (bean.getReportLayout().isHeaderOnEveryPage() && (page > 2)) {
      try {
        printHeaderBand();
      } catch (QueryException e) {
        e.printStackTrace();
      }
    }
  }
コード例 #3
0
 @Override
 protected void newPage() {
   flushNow();
   Br objBr = new Br();
   objBr.setType(STBrType.PAGE);
   P para = createParagraph();
   para.getContent().add(objBr);
   wordMLPackage.getMainDocumentPart().getContent().add(para);
   if (bean.getReportLayout().isHeaderOnEveryPage()) {
     try {
       printHeaderBand();
       newRow = true;
     } catch (QueryException e) {
       e.printStackTrace();
     }
   }
 }