Jump to content
We've recently updated our Privacy Statement, available here ×

Problem loading Subreport over two OSGi bundles


praenti

Recommended Posts

Hi,

I'm trying to load a jasper subreport over two OSGi bundles, but don't get the clue.

I have bundle vwg.audi.calida.jasper where the jar-files for jasper are included and exported. The second bundle is called vwg.audi.calida.eva where you can find the jasper files and the action where the report is started.

In CreateReportAction in do:

JasperReport report = (JasperReport) JRLoader.loadObjectFromLocation(REPORT_FILE, CreateReportAction.class.getClassLoader());

I need to use there the classloader because otherwise jasper would search the report in vwg.audi.calida.jasper and not vwg.audi.calida.eva. The report is created, but the referenced subreport is not found! I suppose this is because jasper searches the subreport in the wrong bundle and I have to set there also the classloader from vwg.audi.calida.eva.

But how can I do that?

Currently I have this in my xml:

<subreport isUsingCache="true" runToBottom="false">
                <reportElement positionType="Float" x="1" y="133" width="802" height="49"/>
                <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanArrayDataSource($F{dataModel}.getSelectedMeaResults())]]></dataSourceExpression>
                <subreportExpression class="java.lang.String"><![CDATA["calida_standard_report_teststeps.jasper"]]></subreportExpression>
            </subreport>

 

Can anybody help me?

Kind Regards

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...