camnott Posted November 30, 2017 Share Posted November 30, 2017 Hello, I am trying to send a variable from a sub report to the main report, and then use the variable in a print when expression to eliminate blank space.The variable is set up exactly the same on master and sub reports name=v_return, class = java.lang.String, calculation = no calculation function, expression = blank, Initial value expression = blank, increment type = none, incrementer factory class name = blank, reset type = noneIn my print when expression - new Boolean($V{v_return}!= null)When I run the report, I get the following Error - net.sf.jasperreports.engine.JRRuntimeException: Increment class not found. Any idea's? I have been searching all day to find a solution, but nothing has helped. Link to comment Share on other sites More sharing options...
peter.w Posted December 1, 2017 Share Posted December 1, 2017 Hi When you say incrementer factory class name = blank, I assume you mean it is blank in the Jasper studio.Check in the source of the report is there an empty string.EG somthing like this:<subreport><returnValue incrementerFactoryClass=""/></subreport>If there is delete the entire incrementerFactoryClass="" elementAlso check that the value you are assigning back is a system not no calculation function.calculation = System Link to comment Share on other sites More sharing options...
camnott Posted December 1, 2017 Author Share Posted December 1, 2017 So - I was finally able to get the report to compile and run, however... The variable on the main report is returning null every time, therefore my band will not print..Code from main report : <variable name="v_return" class="java.lang.String" resetType="None" calculation="System"/><printWhenExpression><![CDATA[new Boolean($V{v_return}!= null)]]></printWhenExpression><returnValue subreportVariable="v_return" toVariable="v_return" calculation="System"/>Sub Report :<variable name="v_return" class="java.lang.String" resetType="None" calculation="System"> <variableExpression><![CDATA[$F{Type}]]></variableExpression> </variable> Link to comment Share on other sites More sharing options...
peter.w Posted December 1, 2017 Share Posted December 1, 2017 Do you know if the subreport detail band being called?Does the main report have a datasoucre that returns something if not you need to just attach it to any datasource and use something like "SELECT 1 as dummy" in your report query. Link to comment Share on other sites More sharing options...
camnott Posted December 1, 2017 Author Share Posted December 1, 2017 Yes to both:Sub report band is called, and variable is actually in the band to show the value pulled. Main report pulls a separate query, sends a parameter to be used as a criteria in the sub report. Sub report sends variable back and prints the main report band based on whether or not the variable is null. 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