Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

crystal reports c# totalpagecount

Posted on 2004-03-24
3
Medium Priority
?
801 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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 video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

618 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