Exemplo n.º 1
0
 protected void createRowProperties(
     List<Property> properties, TrPr trPr, boolean includeDefaultHeight) {
   JAXBElement<CTHeight> trHeight =
       (trPr != null
           ? (JAXBElement<CTHeight>) getElement(trPr.getCnfStyleOrDivIdOrGridBefore(), "trHeight")
           : null);
   if (trHeight != null) {
     properties.add(new TrHeight(trHeight.getValue()));
   }
 }
  @Override
  protected void exportCell(
      String bandName,
      BandElement bandElement,
      Object value,
      int gridRow,
      int row,
      int column,
      int cols,
      int rowSpan,
      int colSpan,
      boolean isImage) {

    if (newRow) {
      // rowNo for a table (it is reset in createTable)
      rowNo++;

      // for first row in page header and page footer we do not add the table row because it will be
      // duplicated
      if (((!ReportLayout.PAGE_HEADER_BAND_NAME.equals(bandName)
              && !ReportLayout.PAGE_FOOTER_BAND_NAME.equals(bandName)))
          || (rowNo > 1)) {
        if (tableRow != null) {
          if (ReportLayout.PAGE_HEADER_BAND_NAME.equals(bandName)) {
            tableHeader.getContent().add(tableRow);
          } else if (ReportLayout.PAGE_FOOTER_BAND_NAME.equals(bandName)) {
            tableFooter.getContent().add(tableRow);
          } else {
            table.getContent().add(tableRow);
          }
        }
        tableRow = factory.createTr();
      }
      // create table header to be available on every page
      if (bean.getReportLayout().isHeaderOnEveryPage()) {
        if (ReportLayout.HEADER_BAND_NAME.equals(bandName)) {
          TrPr rowProperties = new TrPr();
          BooleanDefaultTrue bdt = Context.getWmlObjectFactory().createBooleanDefaultTrue();
          rowProperties
              .getCnfStyleOrDivIdOrGridBefore()
              .add(Context.getWmlObjectFactory().createCTTrPrBaseTblHeader(bdt));
          tableRow.setTrPr(rowProperties);
        }
      }
    }

    renderDocxCell(bandName, bandElement, value, gridRow, rowSpan, colSpan, isImage, column);
  }