protected void exportFrame( TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell) throws IOException, JRException { tableBuilder.buildCellHeader( styleCache.getCellStyle(gridCell), gridCell.getColSpan(), gridCell.getRowSpan()); boolean appendBackcolor = frame.getModeValue() == ModeEnum.OPAQUE && (backcolor == null || frame.getBackcolor().getRGB() != backcolor.getRGB()); if (appendBackcolor) { setBackcolor(frame.getBackcolor()); } try { JRGridLayout layout = gridCell.getLayout(); JRPrintElementIndex frameIndex = new JRPrintElementIndex(reportIndex, pageIndex, gridCell.getWrapper().getAddress()); exportGrid(layout, frameIndex); } finally { if (appendBackcolor) { restoreBackcolor(); } } tableBuilder.buildCellFooter(); }
public void exportText(TableBuilder tableBuilder, JRPrintText text, JRExporterGridCell gridCell) throws IOException { tableBuilder.buildCellHeader( styleCache.getCellStyle(gridCell), gridCell.getColSpan(), gridCell.getRowSpan()); JRStyledText styledText = getStyledText(text); int textLength = 0; if (styledText != null) { textLength = styledText.length(); } tempBodyWriter.write("<text:p text:style-name=\""); tempBodyWriter.write(styleCache.getParagraphStyle(text)); tempBodyWriter.write("\">"); insertPageAnchor(); if (text.getAnchorName() != null) { exportAnchor(JRStringUtil.xmlEncode(text.getAnchorName())); } boolean startedHyperlink = startHyperlink(text, true); if (textLength > 0) { exportStyledText(styledText, getTextLocale(text), startedHyperlink); } if (startedHyperlink) { endHyperlink(true); } tempBodyWriter.write("</text:p>\n"); tableBuilder.buildCellFooter(); }
protected void exportRectangle( TableBuilder tableBuilder, JRPrintRectangle rectangle, JRExporterGridCell gridCell) throws IOException { JRLineBox box = new JRBaseLineBox(null); JRPen pen = box.getPen(); pen.setLineColor(rectangle.getLinePen().getLineColor()); pen.setLineStyle(rectangle.getLinePen().getLineStyleValue()); pen.setLineWidth(rectangle.getLinePen().getLineWidth()); gridCell.setBox(box); // CAUTION: only some exporters set the cell box tableBuilder.buildCellHeader( styleCache.getCellStyle(gridCell), gridCell.getColSpan(), gridCell.getRowSpan()); tableBuilder.buildCellFooter(); }
private void exportEmptyCell(JRExporterGridCell gridCell, int emptyCellColSpan) throws IOException { tempBodyWriter.write("<table:table-cell"); // tempBodyWriter.write(" office:value-type=\"string\""); // if (gridCell == null) // { // tempBodyWriter.write(" table:style-name=\"empty-cell\""); // } // else { tempBodyWriter.write(" table:style-name=\"" + styleCache.getCellStyle(gridCell) + "\""); } if (emptyCellColSpan > 1) { tempBodyWriter.write(" table:number-columns-spanned=\"" + emptyCellColSpan + "\""); } tempBodyWriter.write("/>\n"); exportOccupiedCells(emptyCellColSpan - 1); }