Saturday, February 25, 2012

programatically setting reportViewer datasource

I'm trying to set the DataSource of a ReportViewer programmatically. I'm doing the following but I'm getting the error

  • "A data source instance has not been supplied for the data source 'DataSet1_ORG'". DataSet1_Org is the xml datasource that the .rdlc is bound to.With ReportViewer1 Dim rdsAsNew ReportDataSource("rdsReport","sqlReport") 'sqlReport is a SQLDataSource on the webform

    .LocalReport.DataSources.Clear()

    .LocalReport.DataSources.Add(rds)

    .LocalReport.ReportPath = Server.MapPath("MyReport.rdlc")

    End With

    I know I'm close...it's just a bit elusive.

    Thanks, Alex

    What you can try is go to the Report menu, then to the Data Sources option, remove what is there and add the appropriate data source again.

    |||

    Hello

    you need to click on the reportviewer and select the choose data source and select the datasource that u want

  • No comments:

    Post a Comment