This is a migrated thread and some comments may be shown as answers.

Pass old Report viewer web form To Html5 report viewer web form

2 Answers 314 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zaltius
Top achievements
Rank 1
Zaltius asked on 09 Jan 2017, 01:16 PM

i like to pass the old report viewer to the new html5 viewer.

in the old viewer the funcionality was,

1)  create the report book 

2)  var instanceReportSource = new InstanceReportSource();

    instanceReportSource.ReportDocument = reportBook;
    ReportViewer1.ReportSource = instanceReportSource;
    ReportViewer1.RefreshReport();

 

in the new html5 how can i do this? I've tried it a thousand ways and there's no way

2 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Jan 2017, 04:04 PM
Hi Zaltius,

You will need a custom resolver for the Reporting REST service, in which you can create the ReportBook at run-time and then return the InstanceReportSource. Please check Migrate to the HTML5 Viewer from the old ASP.NET WebForms ReportViewer control and How to display a report via InstanceReportSource in the HTML5 Viewer.

In general:

  1. The HTML5 viewer has a client-side ReportSource, from which we extract the string description of the report (relative path to a TRDP|TRDX file), the assembly qualified name of a report class (<namespace>.<report_class>, <assembly_name>) or custom string (almost anything can be included with respect to REST limitations for used characters and size of the message).
  2. The reports string description is submitted to the server and it is handled by the Reporting REST service's Resolver. The service's default resolvers can handle a relative path to a TRDP|TRDX files or an assembly qualified name of a report class. Anything else requires you to create a custom resolver that returns a server-side ReportSource object on its own.
  3. Once the Report resolver returns the server-side ReportSource object, the viewer submits the Parameters collection of its client-side ReportSource. This Parameters collection is applied as the server-side's ReportSource.Parameters collection.
  4. Next, the reporting engine starts processing the report, means the report events fire, expressions are evaluated. At that moment the server-side ReportSource.Parameters collection is mapped to the report's ReportParameters collection - where Name properties (case sensitive) are the same, values are set for the report parameters.
  5. Finally, the report is rendered and paged in the requested format (HTML for web preview, PDF for export and etc.), and the content id returned to the client(viewer).


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Zaltius
Top achievements
Rank 1
answered on 10 Jan 2017, 10:01 AM

Thank's.

Now i pass one string with idReport and the controller generate the report.

Regards,
Zaltius

Tags
General Discussions
Asked by
Zaltius
Top achievements
Rank 1
Answers by
Stef
Telerik team
Zaltius
Top achievements
Rank 1
Share this question
or