0
votes

I have main report & one subreport (I have used sub report in main reports title band), I have set some alignment & fonts for some of the text fields & static text fields. When I run it via Jasper reports Preview mode it works fine, even export is proper if I export it via preview mode.

But when I am running same .jrxml (main & sub report .jrxml) via java code, the content of main report are getting displayed proper as I want, but only the contents of sub report are not proper aligned.

Please let me know the answers, thanks in advance.

Here is the sub report xml code:

<title>
        <band height="92" splitType="Stretch">
            <subreport>
                <reportElement x="0" y="1" width="1980" height="89" isPrintInFirstWholeBand="true" uuid="a3d62877-7e70-4ea0-8d6b-0f658e37a78d"/>
                <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource ($P{exitMethodReport_SubReportDatasource}.getData())]]></dataSourceExpression>
                <subreportExpression><![CDATA["exit_method_subreport.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </title>
1

1 Answers

0
votes

This usually happens when you have a different (probably older) version of the Jasper library at runtime than the one you used to compile the .jrxml file; resulting in markup elements in your .jasper file that the Jasper runtime doesn't understand.

You should either update your runtime library (recommended) or compile the report to the correct version in iReport.