Hi,
I have a problem when using Aspose.Words for JasperReports to generate docx files. For example, in Jasper Studio’s preview, bar chart legend looks normal, the font is Arial and size is 10:
New Bitmap Image.jpg (18.0 KB)
But when exported to docx, it looks like:
New Bitmap Image - Copy.jpg (995.7 KB)
Looks like the chart image in exported file has very low DPI, can you help me figure it out? Thanks in advance.
Sample jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_Letter" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c5cae0f8-1d9f-49e8-b568-3bb95203d74a">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="net.sf.jasperreports.export.docx.flexible.row.height" value="true"/>
<style name="Arial_Normal_12" isDefault="true" fontName="Arial" fontSize="12" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_Bold_12" isDefault="true" fontName="Arial" fontSize="12" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_bold_12.0Beer" forecolor="#4A4A4A" fontName="Arial" fontSize="12" isBold="true" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<pageHeader>
<band height="40" splitType="Stretch"/>
</pageHeader>
<detail>
<band height="300">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<frame>
<reportElement x="0" y="0" width="572" height="140" uuid="3e4c4e53-1677-4501-b5c9-d8063d7397fb">
<property name="net.sf.jasperreports.export.docx.flexible.row.height" value="true"/>
</reportElement>
<textField>
<reportElement style="Arial_bold_12.0Beer" x="0" y="0" width="300" height="30" uuid="5dac9dd0-dbbe-4044-8fde-d0beaab22da0"/>
<textElement markup="html"/>
<textFieldExpression><![CDATA["MPI Goal (Multiple Points of Interruption)"]]></textFieldExpression>
</textField>
<stackedBarChart>
<chart isShowLegend="true" evaluationTime="Report">
<reportElement x="50" y="30" width="419" height="110" uuid="725b1da7-1f9b-40c4-8ba0-7ed38fd5fbb7"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend>
<font fontName="Arial" size="10"/>
</chartLegend>
</chart>
<categoryDataset>
<categorySeries>
<seriesExpression><![CDATA["CBI Displays"]]></seriesExpression>
<categoryExpression><![CDATA[""]]></categoryExpression>
<valueExpression><![CDATA[93]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA["Target Displays"]]></seriesExpression>
<categoryExpression><![CDATA[""]]></categoryExpression>
<valueExpression><![CDATA[7]]></valueExpression>
</categorySeries>
</categoryDataset>
<barPlot>
<plot orientation="Horizontal">
<seriesColor seriesOrder="0" color="#EB9F4B"/>
<seriesColor seriesOrder="1" color="#F3F3F3"/>
</plot>
<itemLabel/>
<categoryAxisFormat>
<axisFormat labelColor="#4A4A4A" tickLabelColor="#4A4A4A" axisLineColor="#4A4A4A">
<labelFont>
<font fontName="Arial" size="10"/>
</labelFont>
</axisFormat>
</categoryAxisFormat>
<valueAxisFormat>
<axisFormat labelColor="#FFFFFF" tickLabelColor="#FFFFFF" verticalTickLabels="false" axisLineColor="#FFFFFF">
<labelFont>
<font fontName="Arial" size="10"/>
</labelFont>
</axisFormat>
</valueAxisFormat>
</barPlot>
</stackedBarChart>
</frame>
</band>
</detail>
<pageFooter>
<band height="26">
<textField>
<reportElement style="Arial_Normal_12" x="502" y="0" width="45" height="26" forecolor="#747474" uuid="0479da24-dcad-429a-86fe-f3efdfe74a34"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA["Page "]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Arial_Bold_12" x="547" y="0" width="25" height="26" forecolor="#747474" uuid="1b624604-cd70-4e2c-80a8-bdecaad95cc8"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
Some updates: 1, tried “net.sf.jasperreports.image.dpi=300” but no luck
2, opened generated docx, right click on image and go to size, the scale height/width percentages is 133 not 100, why…?