Jump to content
We've recently updated our Privacy Statement, available here ×

Asynchronous Report Generation


codyjasperForge

Recommended Posts

Hello,

 

Can anyone guide me in running reports from the JasperServer repository asynchronously?

 

For example,

the client clicks a link to generate a report, while the report generation is taking place, a small 'progress monitor' is displayed in a small window. The user is then able to navigate throughout the rest of the application while the report is being generated.

 

Any help is appreciated!!!

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Hi!

There functionality for this - look in the JS guide:

 

When listing the reports, you have two icons - the first one of a calendar, to run the report on a schedule, the other one of a table with a blue arrow to the right in front of it, to run the report asychronously.

 

Hope this helps,

Sebastian

Link to comment
Share on other sites

csbac,

 

Care to elaborate on how to get a 'JasperReport' object to compile from the repository?

 

As of now, I am pulling the jrxml as a 'ResourceDescriptor' Object. Now I just need to compile it into a 'JasperReport' so I can implement the AsynchronousFillHandle functionality.

 

I would appreciate Any tips/guidance you could give me. I've searched this forum several times, but none of the results were helpful. :blink:

Post edited by: codyjasperForge, at: 2007/10/10 13:13

Link to comment
Share on other sites

  • 2 weeks later...

Hi!

What are you trying to to ...

Create asynch reports via the web interface, or programmatically?

 

Via the web interface, just follow what I wrote below -- log in as administrator, navigate into the report directory, and click the "run in background", or the "schedule report" icon.

 

Programmatically, I have no idea ... I didn't extend the JS code itself, yet.

 

Yours,

Sebastian

Link to comment
Share on other sites

Since you talk about ResourceDescriptor, I assume you're accessing JasperServer through the web service.

 

If this is the case, it doesn't make sense to compile the report into a JasperReport and fill this report in the client code. The report needs to be executed on the server since all the information required (data source/resources/etc) are located on the server.

 

Therefore if you want to run a report asynchronously, all you have to do is to create a new thread (or fetch one from a thread pool), and invoke the "runReport" web service operation on this thread.

 

Regards,

Lucian

Link to comment
Share on other sites

First of all, Thanks for the replies.

...all you have to do is to create a new thread (or fetch one from a thread pool), and invoke the "runReport" web service operation on this thread.

 

How is it that I "fetch" a thread from a thread pool?

 

Once I do this, is it then possible to have a notification sent, stating that the job has finished execution?

 

Also, other than the docs that are bundled, is there any other documentation of the import/export tool and how it could be used in a web application? I am struggling with this idea as well...

 

Please help.

Post edited by: codyjasperForge, at: 2007/11/12 18:08

Link to comment
Share on other sites

  • 4 weeks later...

codyjasperForge wrote:

How is it that I "fetch" a thread from a thread pool?

 

Thread pools are not a JasperServer feature, but standard Java mechanisms. You can refer to the documentation from Sun (or, if you intend to use other thread pooling implementation, to the documentation of the library), or simply spawn new threads if you don't want to use pools.

 

Once I do this, is it then possible to have a notification sent, stating that the job has finished execution?

 

The JasperServer web service works via synchronous calls. Your application can use this web service in an asynchronous mode (as seen by the end user) by executing the runReport call on a separate thread. Hence it is your application's responsability to handle the required notifications.

 

Since you talk about web applications, I guess that the notifications would be implemented via Ajax-like client requests that poll the execution state. Such solutions would not be specific to JasperServer, so you'd probably find guidelines on dedicated forums.

 

Also, other than the docs that are bundled, is there any other documentation of the import/export tool and how it could be used in a web application? I am struggling with this idea as well...

 

The import/export tool was not meant to be used for this, so it is recommended to leverage the JasperServer web services. The import/export could serve as an alternate solution for functionality not exposed via web services, but integrating them in another application would not be a trivial task.

 

Regards,

Lucian

Link to comment
Share on other sites

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...