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

Report Viewer not rendering

2 Answers 334 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Hal
Top achievements
Rank 1
Hal asked on 23 Jun 2014, 10:14 PM
ASP MVC 4 using old aspx not razor
Bootstrap css
confirmed  /api/reports/formats returns json
so rest service webapi is working

/Reports/telerikReportViewerTemplate.html
returns correctly in the browser

All I get is the following "Telerik.ReportViewer.Mvc.ReportViewerBuilder"


Here is my mark-up
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%=Html.TelerikReporting().ReportViewer()
        // Each report viewer must have an id - it will be used by the initialization script 
        // to find the element and initialize the report viewer.
        .Id("reportViewer1")
        // The url of the service which will provide the report viewer with reports.
        // The service must be properly configured so that the report viewer can 
        // successfully communicate with the server. 
        // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
        .ServiceUrl("/api/reports/")
        // The url for the report viewer template. The template can be edited - 
        // new functionalities can be added and unneeded ones can be removed.
        // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
        .TemplateUrl("/Reports/telerikReportViewerTemplate.html")
        // Strongly typed ReportSource - TypeReportSource or UriReportSource.
        .ReportSource(new TypeReportSource() { TypeName = "Tracker.Services.ReportOpenOpportunities, Tracker.Services" })
        // Specifies whether the viewer is in interactive or print preview mode.
        // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
        // INTERACTIVE - Displays the report in its original width and height witn no paging. Additionally interactivity is enabled.
        .ViewMode(ViewModes.INTERACTIVE)
        // Sets the scale mode of the viewer.
        // Three modes exist currently:
        // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
        // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
        // SPECIFIC - Uses the scale to zoom in and out the report.
        .ScaleMode(ScaleModes.SPECIFIC)
        // Zoom in and out the report using the scale
        // 1.0 is equal to 100%, i.e. the original size of the report
        .Scale(1.0)
        // Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback). 
        // The session is stored in the browser’s sessionStorage and is available for the duration of the page session.
        .PersistSession(false) %>
</asp:Content>

2 Answers, 1 is accepted

Sort by
0
Hal
Top achievements
Rank 1
answered on 24 Jun 2014, 12:15 PM
<%= should be <%:
0
Stef
Telerik team
answered on 26 Jun 2014, 10:53 AM
Hello Hal,

You can use emnedded code( Embedded Code Blocks in ASP.NET Web Pages msdn article) to place the code for the HTML5 Report Viewer MVC extension, or directly use the Javascript widget with script tags in the page markup.

More details about the HTML5 Report Viewer are available in  this forum thread. Yo can also check the local demos installed by default under C:\Program Files (x86)\Telerik\Reporting Q2 2014\Examples\CSharp.

I hope this information helps you.

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
Hal
Top achievements
Rank 1
Answers by
Hal
Top achievements
Rank 1
Stef
Telerik team
Share this question
or