I've been through the docs at least twice and obviously I'm missing quite a bit.
Created two simple, identical, reports with the wizard. One with the report designer, Report1, the other in VS2019, Report2. They are calling a stored procedure in SQL Server 2016, with a parameter. Both preview in the designers just fine. Both reports have a parameter set...@batchid Int32 6000
Stored procedure: select * from batches where batchid=@batchid
I've added the NeedDataSource event to the reports
Telerik.Reporting.UriReportSource uriReportSource =
new
Telerik.Reporting.UriReportSource();
uriReportSource.Parameters.Add(
new
Telerik.Reporting.Parameter(
"@batchid"
, 7929));
uriReportSource.Uri = @
"nunya\Report1.trdp"
;
reportViewer1.reportSource = uriReportSource;
reportViewer1.RefreshReport();
The trdp complains it can't find a connection string. IDK why. There is one in the app.config file which the rest of the application happily uses. When the connection string is embedded, it still does NOT use the Uri parameter.
Telerik.Reporting.TypeReportSource typeReportSource =
new
Telerik.Reporting.TypeReportSource();
typeReportSource.Parameters.Add(
new
Telerik.Reporting.Parameter(
"@batchid"
, 7929));
typeReportSource.TypeName =
typeof
(Report2).AssemblyQualifiedName;
reportViewer.reportSource=typeReportSource;
reportViewer1.RefreshReport();
Here, an exception is thrown in the Report1_NeedDataSource event:.report.Parameters is empty.
Do you have a sample winforms app which uses either the northwind or adventure works databases?
TIA