I manually created a DataSet with a DataTable inside. I would to add with the code values to columns in this DataTable and show them in a Report. But I get different errors.
In my RDLC file I have a DataSource named `companyReportBudget` and a Dataset named `Report`. This dataset has `companyReportBudget` as DataSource and `reportBudget` as Available Dataset.
This is the code that I used in my form to fill the DataTable and show it in the report:
But in line `Dim rds As New ReportDataSource("Report", rptBudget)` the `ReportDataSource` is underlined as error.
The error says:
> Overload resolution failed because no accessible 'New' accepts this
> number of type arguments.
And I think that the error is related to `rptBudget` variable.
What do you suggest?
SYSTEM DETAILS:
OS: Windows 10 Pro (22H2)
Visual Studio: Community 2017 Version 15.9.55
NUGET PACKAGES:
Microsoft.ReportViewer.WinForms.v12 - 12.0.0.1
Microsoft.ReportingServices.ReportViewerControl.Winforms - 150.1586.0
In my RDLC file I have a DataSource named `companyReportBudget` and a Dataset named `Report`. This dataset has `companyReportBudget` as DataSource and `reportBudget` as Available Dataset.
This is the code that I used in my form to fill the DataTable and show it in the report:
VB.NET:
Dim rptBudget As New companyReportBudget.reportBudgetDataTable
rptBudget.Clear()
For Each rowBudget As RequestGetBudget In rowsBudget
Dim reportRow As DataRow = rptBudget.NewRow()
reportRow("num") = rowBudget.number
reportRow("code") = rowBudget.code
rptBudget.Rows.Add(reportRow)
Next
Dim rds As New ReportDataSource("Report", rptBudget)
rptStampaBudget.RefreshReport()
But in line `Dim rds As New ReportDataSource("Report", rptBudget)` the `ReportDataSource` is underlined as error.
The error says:
> Overload resolution failed because no accessible 'New' accepts this
> number of type arguments.
And I think that the error is related to `rptBudget` variable.
What do you suggest?
SYSTEM DETAILS:
OS: Windows 10 Pro (22H2)
Visual Studio: Community 2017 Version 15.9.55
NUGET PACKAGES:
Microsoft.ReportViewer.WinForms.v12 - 12.0.0.1
Microsoft.ReportingServices.ReportViewerControl.Winforms - 150.1586.0