Jump to content

How to prevent creation of new scriptlet


pmaslov

Recommended Posts

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

  • 4 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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,

Lucian

Code:
<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

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...