Skip to Content

Issue with Page N 0f M Crystal Report

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.

r1.png (17.6 kB)
p4.png (21.5 kB)
m4.png (10.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    May 15 at 03:12 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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?

      p2.png (21.0 kB)
  • Jun 13 at 12:22 AM

    Which version of the Crystal SDK are you using and what version of Visual Studio?

    -Dell

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Dell for the response. So in the last image i shared the disabling of navigation forward and backward button was due to our own code. When i commented that piece of code, then navigator arrows were enabled. So we are fine with this now.

      Thank you for your assistance.

      Abhilash