Can I Change the Report Title of Crystal Report at runtime RRS feed

  • Question

  • How can I Change the Report Title of Crystal Report run time.

    Wednesday, July 20, 2011 11:56 AM

All replies

  • You can set the title by using a parameter passed or using a field from your data


    Surender Singh Bhadauria


    Wednesday, July 20, 2011 12:12 PM
  • Not much info, what Report Title do you mean?

    If you mean the name of the Report itself then here's one way I figured out to name the export file from the report name, although it should name itself, but if not then...

    string MyRptName = rpt.FileName.ToString();
    MyRptName = MyRptName.Substring(MyRptName.LastIndexOf(@"\") + 1, (rpt.FileName.Length - 3) - (MyRptName.LastIndexOf(@"\") + 1)) + "xls";

    The last "...+ "xls" is the file extension...

    If you are looking for the info in the Report Summary values then look at this API:

    public class SummaryInfo : CrystalDecisions.CrystalReports.Engine.EngineObjectBase
        Member of CrystalDecisions.CrystalReports.Engine

    which has a ReportTitle member"

    public virtual string ReportTitle { set; get; }
        Member of CrystalDecisions.CrystalReports.Engine.SummaryInfo

    Also, as a suggestion when posting try to add as much details so there is no guessing, it helps all looking for specifics....


    Don Williams
    Wednesday, July 20, 2011 1:43 PM