DOT.NET.DAWGS

Upland Consulting Group

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2015

Changing datasource in rdlc, VB.NET

Note that the datasource name needs to match what was set up in the reportviewer, in this case: ReportDataSet_TestFinancial

<DataSources>

<rsweb:ReportDataSource DataSourceId="ObjectDataSource1"

Name="ReportDataSet_TestFinancial" />

</DataSources>

Dim params As SqlParameter() = {New SqlParameter("@StartDate", "8/23/2007"), _

New SqlParameter("@EndDate", "9/27/2007"), _

New SqlParameter("@UnitID", 61)}

Dim dsFinancials As DataSet

Try

dsFinancials = SqlHelper.ExecuteDataset(Global_asax.gSqlConStr, 30, "spGetFinancialsWeekly", params)

Catch ex As Exception

Dim ErrorHdl As _Error = New _Error

ErrorHdl.HandleException(ex)

dsFinancials = Nothing

End Try

rpvFinancialsWeekly.LocalReport.DataSources.Clear()

rpvFinancialsWeekly.LocalReport.DataSources.Add(
New Microsoft.Reporting.WebForms.ReportDataSource("ReportDataSet_TestFinancial", dsFinancials.Tables(0)))

rpvFinancialsWeekly.DataBind()

rpvFinancialsWeekly.LocalReport.Refresh()


Posted by Admin on Thursday, October 16, 2008 3:04 AM
Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Erik United States

Thursday, October 16, 2008 3:10 AM

Erik

Great post, thanks for the help