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 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();
  }
  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();
  }