caio_merotti Posted June 27 Share Posted June 27 (edited) Hello everyone, Is there any way to call void methods in scriptlet classes? for example, in my subreport I need to call a void method every time an item is printed in the PDF, so I can increase my app's steps using the method below in scriptlet class in java: public void incrementStep() throws JRScriptletException { getBean(ProcessCommand.class).incrementStep(this.getFieldValue(PROCESS_ID).toString()); } When the method is called I get this error: Type mismatch: cannot convert from void to Object\n value = ((com.test.Scriptlet)parameter_REPORT_SCRIPTLET.getValue()).incrementStep() Edited June 27 by caio_merotti Link to comment Share on other sites More sharing options...
lucianc Posted June 29 Share Posted June 29 The easiest solution is to change the method to return something (e.g. Object) and add a return null; statement at the end of the method. Regards, Lucian 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