vmstepanov Posted February 13, 2007 Share Posted February 13, 2007 Hi ALL,How can I return value of variable from jasper report to caller java code? Pseudo-code:set report parametersrun reportget some variable back from report make decision depending on previous step Or Map parameters = new HashMap();parameters.put(key, "value"); JasperPrint jasperPrint = JasperFillManager.fillReportToFile(fileName, parameters, getConnection()); String pageCount = jasperPrint.getVariableValue("PAGE_COUNT"); //METHOD NOT EXISTS, just fantasy followingJavaProcessing(pageCount); I believe this issue could be solved using scriptlet, but I have no idea how to return something from scriptlet in multithreaded environment. Link to comment Share on other sites More sharing options...
minu-moto Posted March 5, 2018 Share Posted March 5, 2018 BaseReportFiller filler = (BaseReportFiller) JRFiller.createReportFiller(DefaultJasperReportsContext.getInstance(), jasperReport);JasperPrint jPrint = filler.fill(parameters, getConnection());Object pageCount = filler.getVariableValue("PAGE_COUNT"); 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