Novaa Posted November 16, 2016 Share Posted November 16, 2016 Hello Jaspersoft Community,i cannot return Variables to my Master report. Can somebody help? Or Explain me how to return values. Subreport Variable: Displayed Content of the Sup Report:Main Report Variable:Return Values: Displayed Content in Main Report: Link to comment Share on other sites More sharing options...
lucianc Posted November 17, 2016 Share Posted November 17, 2016 If you want to display the returned value in the same band as the subreport, you'll have to set evaluationTime="Band" for the text element that displays the return value.Regards,Lucian Link to comment Share on other sites More sharing options...
Novaa Posted November 17, 2016 Author Share Posted November 17, 2016 Thanks for your Answer :)Now i have an other Problem. I want to make an Expression with the Variable that came from the Subreport but my Expressions doesn´t work.I have used this IF CASES:$V{Column_number2} != BigDecimal.ZERO$V{Column_number2} != nullRegardsNovaa Link to comment Share on other sites More sharing options...
ojvm24 Posted November 7, 2023 Share Posted November 7, 2023 Hi, I recommend you pass those values as a param to the report, so you must calculate BEFORE calling the report, let´s say you have a list of items, iterate over the list make the sum, and store it in a variable, then add it as a param, "amount", this variable must be added to the report.BigDecimal total = BigDecimal.ZERO;for( Item i : items){ total = total.add( i.amount);} Map<String, Object> param : new HashMap<>();param.put("amount", total);final JasperPrint print = JasperFillManager.fillReport(report, param, source); // Export the report to a PDF file.JasperExportManager.exportReportToPdfStream(print, out); 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