Skip to Content
author's profile photo Former Member
Former Member

CrystalReportViewer in C# .Net web form

I'm curious if anybody know if it's possible to load the crystal report in the code behind and still use the functionality of the crystal reports viewer in VS2008. I'm using Crystal Reports 2008. I'm able to load the report but can use the functionality of the view like the tree menu, paging, export ect. I added the report to the session but i still get an error about the "report source not found"

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2008 at 11:22 PM

    Hi Sara,

    As i understood,You want to load report to Crystal Report viewer through code.

    Follow this:

     ReportDocument boreportdocument = new ReportDocument();
     CrystalReportViewer1.ReportSource = boreportdocument;

    You can download sample code from the following link:


    Have a look to our DevLibrary:


    Hope this helps!!



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I got it.I was pulling the report from the session but like an idiot I forgot to bind it to the viewer again.

      I added the line below to page_init and all is functioning.

      Thanks for everyones responses.

      OrdbyDateRPT = (ReportDocument)Session["OrdbyDateRPT"];

      CrystalReportViewer1.ReportSource = OrdbyDateRPT;

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.