Jump to content
Changes to the Jaspersoft community edition download ×

Some generated reports are not filled with parameters


motiejunas.tadas

Recommended Posts

Hello,

Everything works smooth, when I'm not using threads in application, while calling jasper API to generate reports. But as I saw, if I will use java thread pools, I could generate reports much faster. Only one problem. When I use thread pools, some reports are generated  wrong - without parameters filled.
 

...ExecutorService executor = Executors.newFixedThreadPool(5);for(int i = 0; i < 1000; i++){    Runnable runnable = new Generator(parameters, "target/resources/Invoice.jasper", "Invoice", i);    executor.execute(runnable);}...public class Generator implements Runnable {...@Overridepublic void run() {    try {        JasperPrint jp = JasperFillManager.fillReport(sourceFileName, params, new JREmptyDataSource());        JasperExportManager.exportReportToPdfFile(jp, "./target/resources/" + printFileName + "-" + counter + ".pdf");...[/code]

I know, that it can be related with subreprot filling, because these jasper API generating methods already working in multi-threading.
Maybe anyone can comment on that? Is it possible to ganerate a lot of reports while using executor pool?

Thanks,
TM 
 

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...