?
Solved

crystal reports c# totalpagecount

Posted on 2004-03-24
3
Medium Priority
?
794 Views
Last Modified: 2007-11-27
Hi
I have a c# application that interfaces with various crystal reports
I need to be able to get the total page count of a crystal report.

I cannot seek to the last page because the table that the report is reading from is 500,000+ records
I am not accessing the crystal reports viewer just the report document.

My intentions are to print the entire report (40,000 + pages)
I would like to burst the report into 1000 page increments and then send the print jobs to different printers
(I will alternate between 2 printers).
I have already written code to burst the report based on different fields in the report but I do not kow how to get the number of pages. So I can stop the printer job. When I need to.

Any help would be appreciated.
0
Comment
Question by:janiescrinc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:janiescrinc
ID: 10757995
Okay, I figured this one out...

as I loop through the pages in an infinite loop. when the startPage exceeds the total number of pages to be exported
an exception is thrown.
I catch the exception and automatically finish printing.
________________________
int batchSize= 1000;
int StartPage= 0;
int EndPage = 0;
try{
   while (1){

   ...
   endPage = endPage + batchSize;
   reportDoc.PrintToPrinter(printerName,startPage,endPage,...);
   startPage = endPage+1;
  ...
  }//end while
}Catch(PrinterException pe){
   ErrorMessage = e.Message();
}

____________________
What will happen with the code above.
Example: Crystal Report Document: 10 pages
BatchSize: 3 pages

1st Run Through >> pages 1-3 are printed (page ranges 0-3)
2nd Run Through >>pages 4-7 are printed (page ranges 4--7)
3rd Run Through >> pages 8-10 are printed (the page ranges 8--11)
4th Run Through >> PrintException Thrown



0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 11023286
PAQed, with points refunded (500)

PashaMod
Community Support Moderator
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question