1670063 - How to persist Crystal Reports using HTTPSession in a custom .NET web application?

SAP Knowledge Base Article - Public

1670063 - How to persist Crystal Reports using HTTPSession in a custom .NET web application?

Symptom

How to persist Crystal Reports using HTTPSession in a custom .NET web application?

Environment

  • Crystal Reports 2008
  • Crystal Reports for Visual Studio 2010
  • Web Application using C#

Resolution

Use following code

if (Session["Report"] == null)
{ 
   boReportDocument = new ReportDocument(); 
   boReportDocument.Load("reportname.rpt"); 
   Session.Add("Report", boReportDocument);
}
CrystalReportViewer.ReportSource = Session["Report"]; 

Keywords

maintain state cr4vs2010 crvs2010 crvs cr net 2008 sdk , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio