Changing datasource in rdlc, VB.NET

by Admin 10/16/2008 3:04:00 AM

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()

Tags:

Comments

10/16/2008 3:10:08 AM

Erik

Great post, thanks for the help

Erik United States

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  December 2016  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Recent comments

Tags

Disclaimer

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

© Copyright 2016

Sign in