on 09-18-2008 8:07 AM
(This is a copy of my original post in )
Hello, this is my first post in these forums, I hope someone here will know the answer to my question, I tried searching for this everywhere but I didn't really find anything.
I'm using Visual Studio 2005 and Crystal Reports that come with it. I've designed a report that gets filled from a DataSet object (no connections to database or anything, just a plain simple DataSet.) The report contains two subreports, both of them are also filled with DataSets.
Everything works fine on my computer and a couple of other testing PCs but when the application is deployed at the customer, it sometimes doesn't work - when the form containing CrystalReportViewer opens, the application freezes. The cursor is changed to hourglass, the report area shows big white blank page and the application is not responding anymore.
I thought that the problem may be with printers, the printer setting were set to my default printer so I changed them to "No Printer" (in Page Setup...) for all three reports (and I also re-imported the subreports after that). Nothing changed.
Also this problem doesn't happen all the time, for example it may not happen in the morning but then in the afternoon it doesn't work anymore.
Any ideas what could be wrong?
Michal
Hi,
Have you tried the closing and disposing of reports object in code.
Regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All of the question in the previous two posts need to be answered. Also; What version of CR are you using?
Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can I have an idea how you did your deployment?also, Is it a web or win app?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, thank you for your responses!
It's a windows forms application, I have a form that contains a single control, the CrystalReportViewer. The function which opens the report first fills a dataset with data, then creates the report and sets its datasource like this:
Dim report As New VertragsuebersichtReport
report.SetDataSource(mainData)
DirectCast(report.ReportDefinition.ReportObjects("Header"), _
CrystalDecisions.CrystalReports.Engine.SubreportObject).OpenSubreport("HeaderReport.rpt").SetDataSource(headerData)
DirectCast(report.ReportDefinition.ReportObjects("Filter"), _
CrystalDecisions.CrystalReports.Engine.SubreportObject).OpenSubreport("FilterReport.rpt").SetDataSource(filterData)
DirectCast(report.Section2.ReportObjects("Text7"), CrystalDecisions.CrystalReports.Engine.TextObject).Text = year
DirectCast(report.Section2.ReportObjects("Text8"), CrystalDecisions.CrystalReports.Engine.TextObject).Text = year + 1
Dim f As New frmReportViewer
f.CrystalReportViewerControl.ReportSource = report
f.Show()
To Amit Singh: I'm not sure what you mean, my application freezes when I try to create and show the report so it never gets to the point where I could possibly close it and dispose it.
Hi Michal,
About the close and dispose method-
When you creates the object of Reportdocument then it will take space in memory depending upon how you are creating them i.e. for every event or once .
As objects created in process with out using the disposing, it would capture whole memory - result - new objects might not be getting created.
Hence it might be a reason of freezing of reports.
As mentioned in the first note that reports are running fine for near about 15 minutes, I suggest you to use this code and also the garbage collection.
Hope this helps
Amit
To add to Amit's note. It may not be a bad idea to check if a report object exists before instantiating it. If it does, do .close and .dispose. Or you can do it on form unload, or after
f.CrystalReportViewerControl.ReportSource = report
f.Show()
Also, download the latest SP for CR 10.2 from here:
https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
Ludek
To clarify, the report loading doesn't work right from the start of the application. I.e. the client starts the application and the first report he tries to open freezes the application. So this is not a close / dispose issue or issue with multiple instances of a report. (Although I believe that having multiple instances of the same report shouldn't be a problem?)
OK. Sorry Michael, but I think we finally have all the info we need.
Oh, one more thing. What's the OS for the boxes that don't work? (If it's Vista, could it be that DEP is getting in the way?)
I'd like to run two utilities to see what's up.
1) Download modules from here;
https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
This utility will help us compare dlls - just to make sure...
here is how to run it:
1) unzip the above file
2) run your app on your development system, process a report. leave the app running
3) Start modules
4) Go to the File menu and select New List -> memory modules
5) save the file as dev.mdl
6) Copy modules to one of the computers that does not work
7) Start the app - let it hang and while it is not responding start modules
😎 Go to the File menu and select New List -> memory modules
9) save the file as client.mdl
10) You can now compare the results. Open both mdls in modules.
11) Expand the "By Process" node, find your app exe and click on it. This will populate the right pane with the dlls loaded. Do this with both mdl files. To see more details, go to the Module menu and select Differences
The second utility I'd like to try is Process Monitor. this is a MS utility that can be downloaded from here:
http://www.microsoft.com/technet/sysinternals/Utilities/SysinternalsSuite.mspx
Run it on the problem computer only. Once you have the log, search for any messages like access denied, could not find file, etc., etc. (The quicker you stop procmon the easier it will be to read the log - it gets quite long fast...)
Ludek
Oh by the way regarding the modules, I very much doubt they will be different between the customer's PC and our testing machines because we did the exact same installation on our testing machines as at the customer (no visual studio, just installed the crystal reports runtimes and our application) but I will try to compare the versions anyway.
The problem didn't come back on friday nor today so I haven't been able to test it anymore. It's been bugging us for a week and now it's gone. There's one thing that has changed - the form which contained the CrystalReportViewer control had in its Load event the following code:
ReportView.RefreshReport()
(ReportView is the CrystalReportViewer control.) I don't know why it was there but I removed it probably on thursday and I think the problem didn't happen ever since then. I'll leave this thread open for a while and if we don't see the problem come back in a couple of days I guess I'll consider this question answered. Thanks for help from everyone who tried to answer this question .
Hi Michal,
Using native memory DB drivers like this one there is no way to see without a debug version of our engine and DB driver to see where and when we are connecting. To get one would require an escalation so R&D could enable logging for the required functions and because this is for info only they would not do it.
Thanks again
Don
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.