Waterman292
New member
- Joined
- Nov 24, 2012
- Messages
- 1
- Programming Experience
- Beginner
Hello
I am busy with a project using VB 2010. I keep getting this error message " Overload Resolution failed because no accessible 'New' is most specific for the arguements.
Here is the some of the code :
' show the correct report
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
' remove previous report
Me.Controls.Remove(RV)
RV.Dispose()
RV = New Microsoft.Reporting.WinForms.ReportViewer
RV.Parent = GroupBox2
RV.Dock = DockStyle.Fill
RV.Visible = True
' check the first report
If ComboBox1.Text = "Total profit for all time" Then
' fill the information for that report
Dim TA As New POSDSTableAdapters.TotalProfitForAllTimeTableAdapter
Dim TmpDS As New POSDS
TA.Fill(TmpDS.TotalProfitForAllTime)
' clear previous DS
RV.LocalReport.DataSources.Clear()
' create new DS
Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("POSDS_TotalProfitForAllTime", TmpDS.TotalProfitForAllTime)
' tell the report control to use the DS, and
' use the report template created by us.
RV.LocalReport.DataSources.Add(RDS)
RV.LocalReport.ReportEmbeddedResource = "POS.TotalProfitForAllTime.rdlc"
RV.RefreshReport()
The problem is with this line of code "Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("POSDS_TotalProfitForAllTime", TmpDS.TotalProfitForAllTime)"
In vb 2008 it works fine. Has anyone have any idea for the fix
Thanks
I am busy with a project using VB 2010. I keep getting this error message " Overload Resolution failed because no accessible 'New' is most specific for the arguements.
Here is the some of the code :
' show the correct report
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
' remove previous report
Me.Controls.Remove(RV)
RV.Dispose()
RV = New Microsoft.Reporting.WinForms.ReportViewer
RV.Parent = GroupBox2
RV.Dock = DockStyle.Fill
RV.Visible = True
' check the first report
If ComboBox1.Text = "Total profit for all time" Then
' fill the information for that report
Dim TA As New POSDSTableAdapters.TotalProfitForAllTimeTableAdapter
Dim TmpDS As New POSDS
TA.Fill(TmpDS.TotalProfitForAllTime)
' clear previous DS
RV.LocalReport.DataSources.Clear()
' create new DS
Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("POSDS_TotalProfitForAllTime", TmpDS.TotalProfitForAllTime)
' tell the report control to use the DS, and
' use the report template created by us.
RV.LocalReport.DataSources.Add(RDS)
RV.LocalReport.ReportEmbeddedResource = "POS.TotalProfitForAllTime.rdlc"
RV.RefreshReport()
The problem is with this line of code "Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("POSDS_TotalProfitForAllTime", TmpDS.TotalProfitForAllTime)"
In vb 2008 it works fine. Has anyone have any idea for the fix
Thanks