none
Microsoft ReportViewer

    Question

  • I am having the following error: Overload resolution failed because no accesible 'New' is most specific for the arguements.

    This is part 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 this line:

                Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("POSDS_TotalProfitForAllTime", TmpDS.TotalProfitForAllTime)

    This code works fine in 2008 but in vb2010 it shows the error.

    I am busy working on a project. Is there a solution for this, please help.

    Sunday, November 25, 2012 8:45 AM

All replies