With the current Jasper plugin it would be ideal to be able to show the progress of a [large] report as it compiles into the viewer. Not entirely sure how to accomplish this without knowing the progress of Jasper’s external compiling process. Any ideas?
I suppose I could show an indeterminate (using a servoy plugin or the built-in servoy dialogs), then run the report, then hide the indeterminate, but that isn’t too elegant and doesn’t really accomplish what I am looking to do.
Does the Jasper JAR or hooks expose it’s progress? I think one might need to be at the API level to do this (unless there is a commercially available or freeware product already in place).
I know some of the Jasper jobs leave one wondering if anything is happening and I don’t recall a progress indicator. It’s certainly a known issue with Jasper. There has been some work done on this topic but I don’t know of a solid solution (there might be one out there ):
Thinking…While Servoy is requesting the JViewer to open the specified report, the status in Servoy is “Ready.” The best fit might be using the built-in servoy state change notification area and the built-in servoy progress bar to show both the progress and a description of what is going on e.g. “Compiling Report”?
I’m not familiar with Servoy and I don’t know what exactly the JasperReports plugin is doing, but I want to help if possible.
In JasperReports there are three major process involved:
report template compilation (JRXML compilation)
report filling (report generation in JR proprietary format; JasperPrint object)
report export to more popular formats such as PDF, HTML, RTF, XLS, etc
The first process, the report compilation does not need to occur every time the report is run, because most of the time report templates are static, so the report compilation is part of the application build process. Already compiled report templates (*.jasper files) are usually deployed in an application. So there is no need to monitor the progress of the report template compilation. It would be hard to achieve, if at all possible. It is like trying to monitor the progress of a *.java file compilation when you run javac. Not only that is very fast, but is also probably impossible.
The second process, the report filling with data, can be monitored if you assign a JR scriptlet instance with your report. A scriptlet in JR is like a listener that listens for events during report generation, such as the creation of a new page, a group breaks or the move to a new line in the data source of the report. This, way you can have a scriptlet that informs you about the progress of the report generation. You can use either the scriptletClass attribute of the report template or the built in REPORT_SCRIPTLET parameter.
The third process, the export process, might not be involved in this particular case, if you display the report with the built-in JR Swing viewer. So no export process occurs. However, if you would like to monitor the progress of the export to PDF (for example), the you could pass a progress monitor instance to the PDF exporter using the PROGRESS_MONITOR exporter parameter that all exporters accept. You’ll be informed every time the exporter moves to a new page during document export.
For more details about this, you can check the samples that are shipped with the JasperReports project distribution.
The patch needs to be applied to the plugin code itself. To do that you would need to check out the plugin code from servoyforge, then apply the patch to your working copy and build. But to be honest, my goal is to see the code implemented into the plugin itself, at which time I would expect to see an incremental release and new files for downloading. Servoy just made a release of this plugin though so I fear it might take a little time for my patch to make its way into the trunk. Also, as it stands now my patch is for Servoy 5+, but the plugin currently supports 4+. Servoy will probably want to see the patch work for 4+, and so that may also slow things down a little. FYI Patrick T. said that he knew a workaround to make the patch work on 4, and he has mentioned he would try to make that happen.
But…if you are using Servoy 5+, and you tell me what version of the plugin you use (meaning chartnscript or basic etc.), I could build the plugin for you w/ the patch implemented.
If you are eager for this feature let me know per above and I will see what I can do.
Jeff
PS Maybe Servoy can comment on their willingness to accept the patch into the trunk and push a minor release to make the feature avaialble…