Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the usage of jasperreports-javaflow?

What is the usage of jasperreports-javaflow?

I referred the below two links, Am not clear. could you elaborate!

http://community.jaspersoft.com/questions/541789/jasperreports-versus-jasperreports-javaflow-libraries-thread-issue

http://community.jaspersoft.com/questions/529333/jasperreports-javaflow-versus-jasperreports

like image 675
Karups Avatar asked Nov 11 '16 05:11

Karups


1 Answers

jasperreports-javaflow is a variant of the standard JasperReports jar that can be used in environments where spawning new Java threads is prohibited. That was the case, for instance, with EJB containers some years ago (don't know if it's still the case). But in most cases the standard JasperReports jar is fine and you don't need to worry about jasperreports-javaflow.

JasperReports creates threads (by default) to render subreports (and table elements) because page/column breaks require the the subreport generation to stop at some point in the call stack and then resume on the new page/column. Commons Javaflow continuations provide a mechanism to do that without threads, and the jasperreports-javaflow jar has classes instrumented for Javaflow continuations. Also see the JasperReports subreport sample documentation.

To use the continuations subreport runner, you need to include the jasperreports-javaflow jar on the classpath (instead of the regular jasperreports jar, you shouldn't have both) along with a Commons Javaflow jar (for instance the one at http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/org/apache/commons/commons-javaflow/20160505/) and to set the following property in jasperreports.properties:

net.sf.jasperreports.subreport.runner.factory=net.sf.jasperreports.engine.fill.JRContinuationSubreportRunnerFactory

Update: Starting with version 6.6.0, JasperReports uses tascalate-javaflow instead of Apache Commons Javaflow (for Java 8 support). Therefore instead of a Commons Javaflow jar you'll need to have a net.tascalate.javaflow.api jar on the classpath (such as net.tascalate.javaflow.api-2.2.1.jar).

like image 164
dada67 Avatar answered Oct 11 '22 04:10

dada67