Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2681

JRHtmlExporter is deprecated - how to use HtmlExporter?

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.5.4
    • Components
    • ZK EE
      JasperReports 6.0.0

      I am using JasperReports 6.0.0 under ZK EE 6.5.4. I have created a .zul file with component Jasperreport, and an JRXML with this column header definiton:

      ----------

      <columnHeader>
      <band height="25" splitType="Stretch">
      <staticText>
      <reportElement mode="Opaque" x="0" y="0" width="555" height="20" backcolor="#70A9A9" />
      <textElement />
      <text><![CDATA[]]></text>
      </staticText>
      <textField>
      <reportElement mode="Transparent" x="0" y="0" width="80" height="20" />
      <textElement verticalAlignment="Middle">
      <font size="12" isBold="true"/>
      </textElement>
      <textFieldExpression class="java.lang.String">
      <![CDATA[$P

      {headerTerm}

      ]]>
      </textFieldExpression>
      </textField>
      <textField>
      <reportElement mode="Transparent" x="80" y="0" width="200" height="20" />
      <textElement textAlignment="Center" verticalAlignment="Middle">
      <font size="12" isBold="true"/>
      </textElement>
      <textFieldExpression class="java.lang.String">
      <![CDATA[$P

      {headerDef}

      ]]>
      </textFieldExpression>
      </textField>
      <textField>
      <reportElement mode="Transparent" x="280" y="3" width="100" height="20" />
      <textElement textAlignment="Center" verticalAlignment="Middle">
      <font size="12" isBold="true"/>
      </textElement>
      <textFieldExpression class="java.lang.String">
      <![CDATA[$P

      {headerGlossary}

      ]]>
      </textFieldExpression>
      </textField>
      </band>
      </columnHeader>

      ----------

      The static text is used to underlay the column header with a colour.

      Exporting the report under ZK with HTML displays only the text, not the colour.
      Exporting the report under ZK with PDF displays the text and the colour.

      For testing I tried JasperExportManager.exportReportToHtmlFile (without ZK) and both - text and colour - are displayed.

      The generated html source code is different.

      I already found out that ZK is using net.sf.jasperreports.engine.export.JRHtmlExporer to export the report.
      This method is declared as deprecated and has been replaced by net.sf.jasperreports.engine.export.HtmlExporter

      I tried both exporters and the result is that

      • with the *JR*HtmlExporter as used by ZK the colour is missing, and
      • using the HTMLExporter everything is fine.

      As the ZK Jasperreport class creates the Exporter object in its private method doReport(), I have no chance to overwrite it.

      Is there any possibility to use the HTMLExporter instead of JRHTMLExporter?

      And it seems that also the current ZK 7 release still uses the deprecated exporter.

            Unassigned Unassigned
            SylviaSteffens SylviaSteffens
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: