I have a web application project.
I've created a single report, bound to a sql data source, no parameters. I can preview the report and see all the data.
Report name: trpt01 - which creates a trpt01.cs and trpt01.resx file.
I've added a reportviewer to the page named rptview.
I have a button on the page and it runs the code to display the report "trpt01" in rptview.
I see examples using UriReportSource and InstanceReportSource. This seems very simple but I cannot get it to run.
If I change ur.Uri to a name I know does not exist.. ie: "abc" or "abc.cs" - the reportviewer gives a "Generating Report" message. I've left it running and it continued for several minutes. If I give it the name "trpt01.cs" it runs and returns a "Data at the root level is invalid. Line 1, position 1." error message.
What am I missing? How do I refer to a report that I have in the root of my project?
6 Answers, 1 is accepted
And now onto more fun.
I m trying to use mentioned code to bind viewer. but it shows error
My reporting version is Telerik.Reporting R1 2017. I have a web application project.
Report name: Report1- which creates a Report1.cs and Report1.resx file.
reportviewer name: reportViewer1
"Cannot implicitly convert type 'Telerik.Reporting.InstanceReportSource' to 'Telerik.ReportViewer.Html5.WebForms.ReportSource'"
The type of the report source must be considered with the type of the viewer and the format of the report (XML, TRDX|TRDP file, run-time instance or a class generated by VS Report Designer). The general purpose of the ReportSource object is to let you specify which report to be displayed, regardless the report format, and what values to be passed to the report's ReportParameters collection.
An example, in case you use the HTML5 WebForms ReportViewer:
For more details and examples, please go through How to: Set ReportSource for Report Viewers.
Telerik by Progress
By report definition I refer to reports designed with the available Report Designers, or generated in code or as XML. Depending on the way the report was created you should use the corresponding ReportSource that let the Reporting engine know how to process the report.
For web viewers, you need a client-side ReportSource, that is processed on the server into a server-side ReportSource.
I hope this helps.