/** * Initialize the main info holder table. * @throws BadElementException for errors during table initialization */ protected void initTable() throws BadElementException { tablePDF = new Table(this.model.getNumberOfColumns()); tablePDF.setDefaultVerticalAlignment(Element.ALIGN_TOP); tablePDF.setCellsFitPage(true); tablePDF.setWidth(100); tablePDF.setPadding(2); tablePDF.setSpacing(0); smallFont = FontFactory.getFont(FontFactory.HELVETICA, 7, Font.NORMAL, new Color(0, 0, 0)); }
/** * Initialize the main info holder table, like the appropriate number of columns. * @param model The table being represented as iText. * @see org.displaytag.render.TableWriterTemplate#writeTableOpener(org.displaytag.model.TableModel) */ protected void writeTableOpener(TableModel model) { this.table.setDefaultVerticalAlignment(Element.ALIGN_TOP); this.table.setCellsFitPage(true); this.table.setWidth(100); this.table.setPadding(2); this.table.setSpacing(0); this.table.setBorder(Rectangle.NO_BORDER); this.defaultFont = this.getTableFont(); }
t.setPadding(TABLE_PADDING); t.setBorderWidth(TABLE_BORDERWIDTH); t.setWidth(TABLE_WIDTH); t.setCellsFitPage(true); t.setOffset(10f);
p.setPadding(TABLE_PADDING); p.setBorderWidth(TABLE_BORDERWIDTH); p.setWidth(TABLE_WIDTH); p.disableBorderSide(Rectangle.LEFT); p.disableBorderSide(Rectangle.RIGHT);
/** * This method creates a report group for the error message on the report * * @throws DocumentException */ private void generateErrorColumnHeaders() throws DocumentException { try { int headerwidths[] = { 60 }; Table aTable = new Table(1, 1); // 2 columns, 1 rows. aTable.setAutoFillEmptyCells(true); aTable.setPadding(3); aTable.setWidths(headerwidths); aTable.setWidth(100); Cell cell; Font font = FontFactory.getFont(FontFactory.HELVETICA, 9, Font.NORMAL); cell = new Cell(new Phrase("Error(s)", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setGrayFill(0.9f); aTable.addCell(cell); this.document.add(aTable); } catch (Exception e) { throw new RuntimeException("DepreciationReport.generateErrorColumnHeaders() - Error: " + e.getMessage()); } }
/** * This method creates the headers for the report statistics */ private void generateColumnHeaders() { try { int headerwidths[] = { 40, 15 }; Table aTable = new Table(2, 1); // 2 columns, 1 rows. aTable.setAutoFillEmptyCells(true); aTable.setPadding(3); aTable.setWidths(headerwidths); aTable.setWidth(100); Cell cell; Font font = FontFactory.getFont(FontFactory.HELVETICA, 9, Font.NORMAL); cell = new Cell(new Phrase(SpringContext.getBean(KualiConfigurationService.class).getPropertyString(CamsKeyConstants.Depreciation.MSG_REPORT_DEPRECIATION_HEADING1), font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setGrayFill(0.9f); aTable.addCell(cell); cell = new Cell(new Phrase(SpringContext.getBean(KualiConfigurationService.class).getPropertyString(CamsKeyConstants.Depreciation.MSG_REPORT_DEPRECIATION_HEADING2), font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setGrayFill(0.9f); aTable.addCell(cell); this.document.add(aTable); } catch (Exception e) { throw new RuntimeException("DepreciationReport.generateColumnHeaders() - Error: " + e.getMessage()); } }
aTable.setPadding(3); aTable.setWidths(columnwidths); aTable.setWidth(100); aTable.setBorder(Rectangle.NO_BORDER);
table = new Table( columnCount, rowCount ); table.setAutoFillEmptyCells( false ); table.setWidth( 100 ); // span the full page..