Show message box in asp.net for display total no of pages in crystal report

Show message box in asp.net for display total no of pages in crystal report:



crystalReportViewer1.ShowLastPage();
            MessageBox.Show(crystalReportViewer1.GetCurrentPageNumber().ToString());
            crystalReportViewer1.ShowNthPage(1);
 Write this on Report Forms load event.





Create a formula that will give you the "fudged" print time.  It will formula will look something like this:
CurrentDateTime + (0.000016 * (PageNumber - 1))

"0.000016" comes from the way that date math works.  The number 1 represents one day (24 hours).  So, to get the value for 1 second, I divided 1 by 24 (hours) and the divided the result by 60 (minutes in an hour) and by 60 again and I rounded up the value.  So, for each page, you're adding roughly 1 second to the time.


For each page, you'll have to add a separate section to the report (I assume you're using a details section for this...).  Place your barcodes using the formula from above. 

 Then format the section and do the following:

1.  Turn on "New Page After".

2.  Click on the formula button to the right of "New Page After" and add something like the following:

                 PageNumber >= {?Page Count Parameter}

This will prevent a blank page from printing at the end of the report.

3.  Click on the formula to the right of "Suppress" and add something like the following:

  {?Page Count Parameter} < [whatever page this section will print]





Other Crystal Report related Post:




Here we give the list of Examples related to gridview:


Comments