I was trying to render rdlc reports in .net core 2.0 and found System.Web is not yet available in .net core. So I started a separate .net standard 2.0 project with in the same solution for the task. Then I was again facing issue with 'ReportDataSource' which in turn is System.Web library. I tried to google for the same but found no luck with the information related to this. Someone please help me to find the possibilities to render rdlc in my .net core project.
Reference to type 'IDataSource' claims it is defined in 'System.Web', but it could not be found
Asked Answered
Are you certain your reporting solution supports .net core? Looks like that's where you need to start. –
Logistician
Reports do support .net core as used one earlier. The problem is with ReportDataSource. I am using this for the reports where i need to append the data source. –
Finer
You can try it like this, it works:
var rds = new ReportDataSource();
rds.Name = "DeviceSalesReport";
rds.Value = result;
dataSource.Add(rds);
While this removes the complaints, it will run into errors because of the lack of System.Web. Internally, System.Web.UI.WebControls is needed from System.Web –
Unesco
_reportViewer.LocalReport.DataSources.Add(new ReportDataSource()
{
Name = "dsVendorSummary",
Value = DT5
});
It would be good to add some explanation and fix the formatting. –
Reptant
Code dumps do not make for good answers. You should explain how and why this solves their problem. I recommend reading, "How do I write a good answer?". This can help future users learn and eventually apply that knowledge to their own code. You are also likely to have positive feedback/upvotes from users, when the code is explained. –
Servia
© 2022 - 2024 — McMap. All rights reserved.