on 05-15-2019 6:40 AM
Hello ,
We are using Crystal Report X1 Release2 as the designer.
Our application is windows application and we are dynamically loading the report file and assigning the data source like below:
var testreport = new ReportDocument();
testreport .Load("Test.rpt");
testReport------- Assign datasource here.
The reports generation is fine and it opens a viewer like below :
When we press save file explorer like below appears :
and then the whole application crashes.
When we investigated further , from the below link we found out that there is a paging field (please refer below image)
https://answers.sap.com/questions/9724230/index.html
as per below image. So if we remove this field (Page N of M) it works fine if report has multiple pages.But how about again if we have single page. We have lot of reports (.rpt) files with Page N of M
So is there any option or update or fix we can do here which fixes this. We are using crystal report runtime -
13.0.22.2668.
Our DLL's are 13.0.24.
Please suggest further thanks.
Page N of M is problematic in a number of ways. The biggest is that when you use it, the report has to render all of the pages - even subreports - before it can either display or export the report. Also, the export from Save regenerates the report completely - it doesn't convert what's in the viewer. So, if the report is large, contains one or more subreports that run multiple times, had lots of images, or any one of a number of other things that will cause it to do a lot of swapping to disk (in its own temp files - Crystal doesn't use Windows swap space), you could be running out of memory or swap space.
Since you're using Crystal for VS, you could potentially write a program that will go through all of your reports and remove the Page N of M and replace it with just PageNumber and then save each report.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
TotalPageCount has the same issue as Page N of M - Crystal has to generate ALL of the pages so that it knows how many pages there are before it can show the first page of the report.
-Dell
That is the correct way to handle it - without Page N of M and without TotalPages. This way Crystal can generate the report one page at a time as it gets to that page and dismiss the page from memory if necessary when it's done saving or emailing it. If you have to display the total number of pages, Crystal has to generate the entire report into memory and then go through each page and and set the page numbers.
-Dell
Hello again Dell,
Thanks for previous reponses. So i tried using formula like below
"Page " & CStr(PageNumber,0) and it just shows me the page number without total page count.So crashing stops here while saving but what is happening with this is ,it stops user to view all the pages. Like below screen if you see there are total 3 pages for this report but the navigation button to view pages is disabled. Any solution we can fix it or any other way please thanks?
Which version of the Crystal SDK are you using and what version of Visual Studio?
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this a web application or a Windows app? If it's a web app, are you storing the report in a session variable in the PageInit event handler? If not, that is probably your problem. If that's not the issue, please open this as a new question so that others will see it.
-Dell
The only thing I can think of would be to upgrade to the latest version of the SDK (SP25). I can't guarantee that will fix the issue, but it might. You'll need to install that version into VS, recompile your application with it, then deploy it with the new version of the runtime. You can get to the download link through here: https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads. When you get to the download page, the orange button is for the .exe that integrates into VS, the blue buttons are for the various runtime options that are available for deploying your application.
-Dell
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.