SAP Knowledge Base Article - Public

1493619 - Error: Object reference not set to an instance of an object


  • Running a Crystal Report in a Visual Studio Application result in the viewer displaying expected paramater prompts
  • Once the parameter prompts are submitted the error is thrown

Reproducing the Issue

Use the following code:

If Not IsPostBack Then
    Crystalreportviewerew1.Reportsource = rpt
End If


Due to the parameter prompt the correct way to code is as follows:

If Not IsPostBacK Then
   dim rpt as New ReportDocument
  'Execute logon code. If required by the report.
   Session("myRpt")= rpt
End If
CrystalreportViewer1.ReportSource = Session("myRpt")


KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To


Crystal Reports 2008 V1 ; SAP Crystal Reports XI R2