none
'Object not set to instance of an object' when adding reportdatasource to ReportViewer 10 in local mode RRS feed

  • Question

  • I recently Updated my VS2008 Reporting web app to VS2010. Now using the new report viewer the first problem I encountered was that it needed a scriptmanager directly on the page. So i did that and got past it.

    Now when I try to programmatically add my datasource it throws a null execption and tell me my 'Object not set to instance of an object'. This code worked fine under Report Viewer 9. what am I doing wrong?

     

     

    Dim sqlOmnibill As New ReportDataSource("sqlOmnibill", ds.Tables(0))

    ReportViewer1.Width = 1000

    ReportViewer1.Height = 500

    ReportViewer1.ProcessingMode =

     

    ProcessingMode.Local

    ReportViewer1.ShowRefreshButton =

     

    True

    ReportViewer1.ShowPrintButton =

     

    True

    ReportViewer1.ShowExportControls =

     

    True

    ReportViewer1.ShowToolBar =

     

    True

    ReportViewer1.ShowZoomControl =

     

    True

    ReportViewer1.ShowFindControls =

     

    True

    ReportViewer1.ShowDocumentMapButton =

     

    True

    ReportViewer1.ShowReportBody =

     

    True

    ReportViewer1.ShowPageNavigationControls =

     

    True

    ReportViewer1.ZoomMode =

     

    ZoomMode.Percent

    ReportViewer1.ZoomPercent = 100

    ReportViewer1.Visible =

     

    True

    ReportViewer1.LocalReport.DataSources.Add(sqlOmnibill)

     

     

    Monday, January 10, 2011 5:32 PM