locked
How to show the totalpage number with c# RRS feed

  • Question

  • dear all

    i am a newbie

    today i have a question in CR 11

    How to use code to show the totalpagenumber in My Winform Application(Not VB.NET)

    my environment C# 2005 ,CR 11

    HELP me pls!

    Wednesday, November 29, 2006 3:57 PM

Answers

  • crReport.FormatEngine.GetLastPageNumber(New CrystalDecisions.Shared.ReportPageRequestContext());

    where crReport is of type ReportDocument.

    you must have set parameters and database logon or else this will throw an error.

    Thursday, November 30, 2006 11:30 PM

All replies

  • crReport.FormatEngine.GetLastPageNumber(New CrystalDecisions.Shared.ReportPageRequestContext());

    where crReport is of type ReportDocument.

    you must have set parameters and database logon or else this will throw an error.

    Thursday, November 30, 2006 11:30 PM
  • dear

    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;

     

    but i can not find this FormatEngine in C#

     

     

     

    Friday, December 1, 2006 3:44 PM
  • FormatEngine is a hidden member off of the ReportDocument that you can access.  Once you type it in, you will see all the methods available off of it.

    Friday, December 1, 2006 7:11 PM
  • i type it ,but i can not see the FormatEngine Object....

    code:ReportDocument rd=new ReportDocument()

    rd.FormatEngine is not found

    i have not try in VB.NET ,I try it in C#.NET

     

    mewdied help me pls

    Saturday, December 2, 2006 5:52 PM
  • which version of Visual Studio are you using, and which version of Crystal Reports.  I was trying with C# in Visual Studio 2003 and Crystal 10.0.  You will not see FormatEngine, you need to put in the whole line that i gave.  It will return an int that is the number of pages.
    Saturday, December 2, 2006 7:15 PM
  • mewdied ,

    you said right !!

    i must type all code in c# 2005.

    (myreport.FormatEngine.GetLastPageNumber(new CrystalDecisions.Shared.ReportPageRequestContext())

    may be c# is Hidden this method..

    by the way thanks a lot !

    you give a good answer , give you a flower!!!thanks

    Sunday, December 3, 2006 1:05 PM