Click to See Complete Forum and Search --> : Crystal Report Viewer performance issues.
Jenner
Mar 27th, 2009, 03:46 PM
I've had no problems using the Crystal Reports Viewer for the most part. Recently though, I'm having problems with a "large data report".
My VB.NET code is pulling two tables from a database and dumping it to a DataSet. Table one has around 4000 items, and table two has around 16000. Filling the DataSet takes about 1 second.
Now I have controls in place to filter the selection down to more reasonable numbers, and when you do this, there isn't an issue. The problem is, a customer using our software might decide to "show all records".
The report takes approximately 4 minutes to bring to screen in this case. I can't seem to implement a cursor change to a wait-state because the code to load up and display the report seems to be handled asynchronously and thus, my subroutine ends; yet the application is locked until the damned report comes up.
Also, there's no Abort button; i.e. a "Sorry, I'm an idiot for trying to make you paginate through 260 pages of report! I'd like to stop and narrow my selection now without having to forcibly kill the application."
Does anyone have any suggestions for how to handle such a beast? Is there a way to make the thing abort? Or only bring up pages on demand? Or bring up the first page, but background fill the remaining pages (where you can't go to another page until it gets done)? Or a way to implement a progress bar or even have the mouse show a Wait Cursor? Anything that'll free up my UI thread. :(
I'm using the version of CR that comes with VB2k8 Pro by the way if that helps.
Any help would be most appreciated.
jggtz
Mar 28th, 2009, 12:17 AM
Check if the Crystal Reports Viewer has available events such as DownloadStarted and DownloadFinished
Jenner
Apr 21st, 2009, 10:16 AM
No, I'm afraid it doesn't. The Crystal Reports Viewer control seems pretty "lite" on useful features. Sorry for the month-late response, I got prioritized to put out a major fire and forgot about this issue.
SergoT
May 26th, 2009, 09:38 AM
Hi,
I am having the same problem with Crystal Report Viewer when I am trying to display a long report ( about 1500 pages). It takes couple min to run.
I thought may be because I am using CrystalReportViewer directly on my windows form and it shares the same thread, UI is not responsive.
I made one step further.
I created my own UserControl with CrystalReportViewer, ProgressBar and Label controls to notify the end user.
My UserControl has all necessary methods and properties to supply database path, to read report path, parameters and supply parameter values.
Everything works great expert again the UI is not responsive at all.
The user has to wait until report will be shown completely in order to i.e. move the form.
I am thinking the CrystalReportViewer executes asynchronously
and the main UI thread should wait till operation will be completed.
Please let me know if you resolved this issue.
Any code samples will be much appreciated.
Thanks.
Jenner
May 26th, 2009, 11:35 AM
I've made no progress with this. What the control really needs to do is pagenate asynchronously as you mentioned. That way, at least page 1 will be shown and then it would grind the other pages in the background keeping the UI free unless the user immediately tried to goto a higher numbered page.
How did you get the progressbar to function? What are you hooking into to get progress?
GaryMazzone
May 26th, 2009, 11:39 AM
I have found this to be a feature (?) of CR. They do things the way they want and the result is to bad if it is not what you would expect.
I went to one of their roadshows one time and spoke with one of the developers. My question was answered this way. "Yup your right, what we do sucks but it is the way the program works, and since it works you need to live with it we will not be changeing things that are not broken."
SergoT
May 26th, 2009, 08:07 PM
I've made no progress with this. What the control really needs to do is pagenate asynchronously as you mentioned. That way, at least page 1 will be shown and then it would grind the other pages in the background keeping the UI free unless the user immediately tried to goto a higher numbered page.
How did you get the progressbar to function? What are you hooking into to get progress?
Hi,
Give me some time till this weekend.
The project has more scope than you need.
I will create a new sample project and send it to you.
Thank you for your reply.
I spent 2 days trying to make it working the way it should work.
I thought I was doing something wrong until I found this thread.
Bruce Fox
May 28th, 2009, 03:12 AM
Can the report task be placed into a BackgroundWorker (however, I'm sure you have though of this)? At least that way you could free up the UI in the original tread.
Jenner
May 28th, 2009, 08:02 AM
I'd have to have the form leave a blank area for the report viewer object, and spin off a secondary thread and create one on the fly every time I run a report. The problem is, the report viewer object IS the object doing all the processing, so if you just have it sitting on your form at design time, then the main UI thread WILL be used for the processing of it.
The problem is, it takes 1 second to pull 1000 records from the database and fill them into a DataSet. That's fine. Then I set that DataSet as the Datasource of the Report object. This is also fine. Finally, I hand the Report object to the CrystalReportViewer... 2 minute freeze of my UI thread as the viewer control processes all 200 pages of data (5 records to a page). It all happens in ONE line of code and it's all internal to the CrystalReportViewer object unless there's a way to grind that information in the Report object before even handing it to the viewer.
I may try the "dynamically make the control in an external thread" method when I have more time, but I got a deadline for some other things, so it's on the backburner till next week.
SergoT
May 28th, 2009, 08:17 AM
Can the report task be placed into a BackgroundWorker (however, I'm sure you have though of this)? At least that way you could free up the UI in the original tread.
I've already tried this.
Report renders asynchronously and UI thread still has to wait until it's done. I was thinking to use caching but this is not supported for Crystal Report Viewer for Windows forms.
I am thinking I will implement another approach to handle large reports but this requires more programming. I will perform all required calculation, records selection and etc. inside UI thread and after I will display all records on Data Grid View control.
After the end user can screen records and by clicking on row individual report will be display.
Thank you for your suggestion.
Bruce Fox
May 29th, 2009, 02:32 AM
The Forms Over Data Videos show an example where by the a list of people are shown in a menu structure down the left hand side of the report viewer, it is only then when the user selects a person does that data (for that person) get shown as a report. This method relates to the MS Report, however, CR may have something similar.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.