• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1511
  • Last Modified:

Get the number of pages in asp.net Crystal Report

I would like to Get the Number of pages in asp.net Crystal Report.  I want to show it on my aspx form along with the report.  I don't want to use the toolbar, so I figured I could easily get this number.

It seems tricky, but maybe someone knows how?
0
Rog D
Asked:
Rog D
  • 3
  • 3
  • 3
  • +1
1 Solution
 
mlmccCommented:
What version of Crystal?

mlmcc
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
Visual Studio 2005 Cryatal 10?
0
 
mlmccCommented:
I suspect the value may not be available.  Crystal.Net (the Crystal distributed with Visual Studio) is limited in some respects.

mlmcc
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Bob LearnedCommented:
Mike, I think it still supports TotalPageCount, but I haven't test it on a web page.

Bob
0
 
mlmccCommented:
I don't have the .Net version or web pages to test against.

mlmcc
0
 
Bob LearnedCommented:
We both "know" someone who does *WINK*, so we can approach this as if it were a standard Crystal report, and see if I was right.

Bob
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
The "TotalPageCount" is not a property of the CrystalreportDocument object or the CrystalReportViewer at least in the ASP.net version of these objects.

Rog
0
 
Bob LearnedCommented:
Well, there you are--proof that it doesn't work (bummer).

Bob
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
No Answer was givin but will give points to close out question.
0
 
djaniszynCommented:
There are two ways in which to achieve this. The first (non recommended) rather crude way is to move to the last page then directly to the first page. Something like:
            crViewer.ShowLastPage();
            crViewer.ShowFirstPage();
where crViewer is your crystal report viewer.

The better way to handle this is to simply change the page number at the bottom of the report (defaults to just the page number) to displaying the special field "Page N of M". This can be found in the field explorer under "Special Fields". The crystal report viewer toolbar then picks this up and displays the correct end page instead of 1+
0
 
djaniszynCommented:
Sorry, read the question a bit too quickly. If you don't want to use the toolbar you can use crViewer.ViewInfo.LastPageNumber to retrieve the last page number. You may need to follow the above guidelines as well. Also note that you will need to call this after the control has rendered (eg by hooking onto the AfterRenderObject event), otherwise it will also return an incorrect result.
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 3
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now