pmaslov Posted November 15, 2009 Share Posted November 15, 2009 Hi, we are having problem with migrating from jasperreports 3.0 to 3.6. The problem occurs in reports where we are using a custom scriptlet which is initialized with a parameter. The instance of the scriptlet is created outside of Jasperreports and passed as REPORT_SCRIPTLET parameter when report is filled. The report has a cosstab inside which uses a custom data source. It seems that the Jasperreports 3.6 framework is creating a new instance of the scriptlet for that data source. As oppose to version 3.0 which was reusing the instance that was passed as REPORT_SCRIPTLET parameter. The new scriptlet instance is created by framework (using default contructor) and does not work properly.Is there a way to prevent creating of scriptlet instances by framework? Regards Link to comment Share on other sites More sharing options...
lucianc Posted December 10, 2009 Share Posted December 10, 2009 That's a bug, log it using the project trackers.A workaround is to explicitly pass a scriptlet instance to the crosstab dataset, see below.Regards,LucianCode:<crosstabDataset> <dataset> <datasetRun subDataset=".."> <datasetParameter name="REPORT_SCRIPTLET"> <datasetParameterExpression><![CDATA[new net.sf.jasperreports.engine.JRDefaultScriptlet()]]></datasetParameterExpression> </datasetParameter> </datasetRun> </dataset></crosstabDataset> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now