REPORTVIEW

Hello...

I am trying to switch between to reports(rdlc), in one reportviewer( not Crystal report but MS). I want to use a timer...

I get an error saying, that there is no datasource set for the report..


this is my code :

[code]Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim ReportDataSource1 = New Microsoft.Reporting.WinForms.ReportDataSource()

Select Case Me.ReportViewer_main.LocalReport.ReportEmbeddedResource

Case "DeskTopKalk.Report_Hour_Md3.rdlc"

ReportDataSource1.Name = "Mamconnection_Report_Hour_Sum"

ReportDataSource1.Value = Me.Report_Hour_SumBindingSource

Me.ReportViewer_main.Reset()

Me.ReportViewer_main.LocalReport.DataSources.Clear()

Me.ReportViewer_main.ProcessingMode = ProcessingMode.Local

Me.ReportViewer_main.LocalReport.DataSources.Add(ReportDataSource1)

Me.ReportViewer_main.LocalReport.ReportEmbeddedResource = "DeskTopKalk.Report_Hour_Sum.rdlc"

Me.ReportViewer_main.RefreshReport()


Case "DeskTopKalk.Report_Hour_Sum.rdlc"

ReportDataSource1.Name = "Mamconnection_Report_Hour_Md3"

ReportDataSource1.Value = Me.Report_Hour_Md3BindingSource

Me.ReportViewer_main.Reset()

Me.ReportViewer_main.LocalReport.DataSources.Clear()

Me.ReportViewer_main.ProcessingMode = ProcessingMode.Local

Me.ReportViewer_main.LocalReport.DataSources.Add(ReportDataSource1)

Me.ReportViewer_main.LocalReport.ReportEmbeddedResource = "DeskTopKalk.Report_Hour_Md3.rdlc"

Me.ReportViewer_main.RefreshReport()


End Select


End Sub [/code]


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories