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

AngularJS 1.5.0 and Telerik Reports

4 Answers 270 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shahbaz
Top achievements
Rank 1
Shahbaz asked on 21 Nov 2016, 06:01 AM

Hello,

I'm using AngularJS 1.5.0 and trying to integrate telerik reports in SPA. I found this article . However this version is using ui-router, while as Angular 1.5.0 has moved to ng-route.

Can you please share sample application with ng-route?

Apprciate quick response.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 21 Nov 2016, 03:49 PM
Hello Yousuf,

In general, there is no AngularJS viewer. By adding a reference to jQuery you can use the HTML5 Viewer - HTML/CSS/JS based widget that can be added via Javascript or directly in the markup of the HTML page. This is illustrated with the example in HTML5 Viewer in AngularJS project.

To pass values to report parameters, via Javascript you can update the viewer's reportSource.parameters collection that is mapped by key to the report's ReportParameters collection - Report Sources Parameters. Please consider the example in How To: Pass Values to Report Parameters.

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
Shahbaz
Top achievements
Rank 1
answered on 23 Nov 2016, 09:09 AM

Hi Stef,

Thanks for your reply. The demo application posted here works when i run the solution from Visual Studio. However when i host the application on IIS, it's throwing error 

"Error loading the report viewer's templates. (Template = /api/reports/resources/templates/telerikReportViewerTemplate-html)."

You can test by hosting the above application on your environment and check the same.

Please see the attached screenshot for error.

Kindly advise.

0
Shahbaz
Top achievements
Rank 1
answered on 23 Nov 2016, 09:10 AM
Demo Application posted here.
0
Stef
Telerik team
answered on 24 Nov 2016, 03:53 PM
Hello Shahbaz,

The error is related to the relative paths used for loading CSS, JS files and for setting the HTML5 Viewer's serviceUrl. They must be adjusted based on the project structure and the hosting.

In this case, test removing the leading '/':
//index.html
<script src="ReportViewer/js/kendo.subset.2015.3.930.min.js"></script>
<script src="ReportViewer/js/telerikReportViewer-10.2.16.1025.min.js"></script>
 
//scripts.js
//line 73
serviceUrl: 'api/reports/',


More details about the error are available in HTML5 Viewer Troubleshooting.

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
Tags
General Discussions
Asked by
Shahbaz
Top achievements
Rank 1
Answers by
Stef
Telerik team
Shahbaz
Top achievements
Rank 1
Share this question
or