Skip to content

Commit

Permalink
[Jasper Reports] Use textAdjust instead of isStretchWithOverflow
Browse files Browse the repository at this point in the history
- isStretchWithOverflow is deprecated since version 6.11.0

- And re-enable logging in JasperReportsExporter
  • Loading branch information
Phillipus committed Jan 10, 2025
1 parent adb5258 commit b4d2cbe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
</columnHeader>
<detail>
<band height="16">
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Table row" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="257" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Table row" stretchType="RelativeToBandHeight" x="257" y="0" width="257" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$F{type}]]></textFieldExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</title>
<detail>
<band height="34">
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Normal" positionType="Float" x="0" y="0" width="515" height="16">
<property name="net.sf.jasperreports.export.pdf.tag.h2"/>
</reportElement>
Expand All @@ -55,12 +55,12 @@
</band>
<band height="32">
<printWhenExpression><![CDATA[$F{relation_source} != null]]></printWhenExpression>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Table row" positionType="Float" x="150" y="0" width="365" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$F{relation_source}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Table row" positionType="Float" x="150" y="16" width="365" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$F{relation_target}]]></textFieldExpression>
Expand All @@ -85,12 +85,12 @@
<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ElementsDataSource)$P{REPORT_DATA_SOURCE}).getPropertiesDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="16" width="515">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table header" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="150" height="16" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{key}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table row" positionType="Float" stretchType="RelativeToBandHeight" x="150" y="0" width="365" height="16" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{value}]]></textFieldExpression>
Expand All @@ -108,12 +108,12 @@
<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ViewChildrenDataSource)$P{REPORT_DATA_SOURCE}).getPropertiesDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="16" width="515">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table header" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="150" height="16" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{key}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table row" positionType="Float" stretchType="RelativeToBandHeight" x="150" y="0" width="365" height="16" isRemoveLineWhenBlank="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{value}]]></textFieldExpression>
Expand All @@ -124,7 +124,7 @@
</band>
<band height="26">
<printWhenExpression><![CDATA[$F{documentation} != null]]></printWhenExpression>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Documentation" positionType="Float" x="1" y="8" width="514" height="18"/>
<textElement/>
<textFieldExpression><![CDATA[$F{documentation}]]></textFieldExpression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</background>
<title>
<band height="600">
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Title" x="1" y="317" width="515" height="30" uuid="2d4ddc5a-2ceb-4009-8924-7162bf312526"/>
<textElement textAlignment="Left">
<font size="22"/>
Expand Down Expand Up @@ -191,7 +191,7 @@
<detail>
<band height="45">
<printWhenExpression><![CDATA[$F{name} != null]]></printWhenExpression>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Normal" x="0" y="30" width="515" height="15" uuid="38784cb9-ab24-4fac-9438-ab7792b48648"/>
<textFieldExpression><![CDATA[$F{purpose}]]></textFieldExpression>
</textField>
Expand Down Expand Up @@ -219,13 +219,13 @@
<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ArchimateModelDataSource)$P{REPORT_DATA_SOURCE}).getPropertiesDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="16" width="515">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table header" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="150" height="16" isRemoveLineWhenBlank="true" uuid="61c6657c-7156-49a1-b0f3-4b5faaf93126">
<printWhenExpression><![CDATA[! $F{key}.startsWith("Report:")]]></printWhenExpression>
</reportElement>
<textFieldExpression><![CDATA[$F{key}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table row" positionType="Float" stretchType="RelativeToBandHeight" x="150" y="0" width="365" height="16" uuid="3ee6d5f0-8af5-401b-a82f-682568f2efef">
<printWhenExpression><![CDATA[! $F{key}.startsWith("Report:")]]></printWhenExpression>
</reportElement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<printWhenExpression><![CDATA[$V{REPORT_ENTRY} != 1]]></printWhenExpression>
</reportElement>
</break>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Title 2" x="0" y="1" width="515" height="19"/>
<textElement textAlignment="Left" verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$P{HIDE_VIEW_NUMBERING}.equals("true") ? $F{name}.replaceAll("^[0-9.]* *", "") : $F{name}]]></textFieldExpression>
Expand Down Expand Up @@ -123,7 +123,7 @@
<textElement verticalAlignment="Bottom"/>
<textFieldExpression><![CDATA[$R{text.documentation}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<textField textAdjust="StretchHeight">
<reportElement style="Documentation" x="0" y="38" width="515" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$F{documentation}]]></textFieldExpression>
Expand Down Expand Up @@ -152,14 +152,14 @@
<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ViewModelDataSource)$P{REPORT_DATA_SOURCE}).getPropertiesDataSource()]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="16" width="515">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table header" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="150" height="16" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[!$F{key}.startsWith("Report:")]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{key}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<textField textAdjust="StretchHeight" isBlankWhenNull="true">
<reportElement style="Table row" positionType="Float" stretchType="RelativeToBandHeight" x="150" y="0" width="365" height="16">
<printWhenExpression><![CDATA[!$F{key}.startsWith("Report:")]]></printWhenExpression>
</reportElement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public JasperReportsExporter(IArchimateModel model, File exportFolder, String ex
fLocale = locale == null ? Locale.getDefault() : locale;

// Stop logging
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog"); //$NON-NLS-1$//$NON-NLS-2$
// System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog"); //$NON-NLS-1$//$NON-NLS-2$
}

/**
Expand Down

0 comments on commit b4d2cbe

Please sign in to comment.