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

Call service to bind the report

1 Answer 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
faris
Top achievements
Rank 1
faris asked on 24 Dec 2014, 07:04 AM
Hye.

i use MVC (Html5) to call the report. how to call the service for binding the report?
mean example
html5 call webapi
http://xxxxxx/api/reports/getCompany

in Webapi >
public class GetCompanyController {
public (what type need to return?) GetCompanyController(what parameter need request?)
   companyService.getCompany();
}

is it possible?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 25 Dec 2014, 02:43 PM
Hi Faris,

In general, the HTML5 Report Viewer is a client-side widget served only by a running Reporting REST service, which is dedicated to display already created reports. It is the service that manages the report state and resources.

Details how to add the viewer via template are available in the HTML5 Report Viewer Quickstart article


How the viewer(client)-service pair works:

Basically, the client (viewer) sends string description of the requested report (the viewer's reportSource.report value) to the service, and depending on the report resolvers in the service's CreateReportResolver method this string description will be resolved to a report source object.
By default we provide ReportFileResolver and ReportTypeResolver. You can also create your own report resolvers as in the example in the How To: Implement a Custom Report Resolver article.

Depending on how the application will be hosted, you can use the corresponding cache storage for the service - REST Service storage. If the service will be hosted separately, and will use a different domain you may need to enable CORS to allow the communication between the clients(viewers) and the service.


For a working demo, check the local examples installed by default under C:\Program Files (x86)\Telerik\Reporting <VERSION>\Examples\CSharp.


The recommended troubleshooting approach when using the viewer is to use the browser's Console or download and install Fiddler. In Fiddler - Inspectors - Request/Response - Raw tabs will be listed information about the made request and its response, including a list of all performed requests for the page.


I hope the provided information is helpful.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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