2001 JI Open Discussion Posted August 21, 2006 Share Posted August 21, 2006 By: Code_Slave - code_slave progress monitor 2005-10-27 03:31using jasper reports 1.1.0 on one of my reports it is taking 3 minutes to fill the report of 34 pages. the users keep quitting the application, thinking it has crashed (windows right!!) how can i add a progress bar for filling & printing, it does not need to be 100% accurate, just to stop the user quitting By: Teodor Danciu - teodord RE: progress monitor 2005-10-27 05:14 Hi, I don't understand why the report filling takes so long for only 34 pages. I would investigate that first. Is the engine iterating through huge amounts of data, although it only display some of this data? The engine does not know how many pages or how many records there will be in the datasource in order to tell how much it remains before the document is done. In any case, you could use the AsynchronousFillHandle to allow users to cancel the report and you could also use scriptlets to keep track of progress during filling. I hope this helps. Teodor By: Daren O - rckrll106 RE: progress monitor 2005-10-27 07:54Just wanted to add that using scriptlets is probably the best way to go like Teodor meantioned. However, we use our own custom datasources that implement JRDataSource. For filling a report and tracking its progress we pass a progress monitor in with the data and increment in the next() method. (This is somewhat of the same concept as the progress monitor for exporting a report.) Just thought I'd suggest another way of doing it. By: Doug Berkland - berkland RE: progress monitor 2005-10-27 08:28If all you need is some movement so the users don't give up. Two ideas come to mind. 1 - If you are using a Swing-based UI, you could add a javax.swing.JProgressBar and call progressBar.setIndeterminate(true). This will cause the constant side-to-side motion on the progress bar until you hide the progress bar or call progressBar.setIndeterminate(false) 2 - Create/find an animated GIF or other animated format that you will make visible while the report is running. Either of those will probably be less work. I agree with teodor though. It sounds like you have some major problems. If you only generate small reports like this, fixing the performance issues may get you to a point where having an animation won't be such an issue. By: Code_Slave - code_slave RE: progress monitor 2005-10-27 17:11all the data is being displayed there are 34 fields (on 1 line) and 1600 records. & a custom data source. rather than writing a fixed customdatasource that needs changing every time the report is changed, i have written a more flexable one where the customdatasource adapts to the data from the database. the column headers are stored in a hashmap, along with a interger position when jasper performs getFieldValue(), it passes in the col name, which is then looked up and an interger is returned which is mapped into a vector of the row data. I cannot think of a faster way. what i am toying with is: getting the number of records from the datasource (done!) in the customdatasource next() method, either incrementing a counter or getting the current record no from the database (done) looks like im thinking along the same lines as rckrill106 By: Code_Slave - code_slave RE: progress monitor 2005-10-27 17:18 the other stupidity , is that Ireports ,INSISTS of casting numrical fields to a Double, instead of using the reported type from the database, so in your customdatasource you have to "if" every object & if it is a number "cast it to a Double" I suspect that this is slowing it down By: Code_Slave - code_slave RE: progress monitor 2005-10-28 16:17K, after a re-write of the getFieldValue() we are down to 55 seconds for 34 pages, Damn those string compares, and syncronised lists. I just need IReports to stop screwing about with the returned {MetaData }types from the database now 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