Virtual directory problem

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Nov 2016

    Posted 03 Nov Link to this post

    Hello,

    I use Telerik MVC. Sample Report viewer, created with Visual Studio 'Teleik MVC Report Viewer' works fine. I use .trdp file from disk.  But it works only in IISExpress, with UTL like http://localhost:51330/. When I tried do same in VD, it shows Viewer controls, renders process of reportting, shows 8 pages completed (correct), but does not show report's content. And viewer controls looks incomplete. I think, the problem is in relative paths.I have changed all path to absolute, but it does not help

       <script src="@Url.Content("http://localhost/MY_VD/ReportViewer/js/kendo.subset.2015.3.930.min.js")"></script>

    ...
    <script src="@Url.Content("http://localhost/MY_VD/ReportViewer/js/telerikReportViewer-10.2.16.914.min.js")"></script>

    .

    @(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 serve reports.
            // The URL corresponds to the name of the controller class (ReportsController).
            // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
            .ServiceUrl(Url.Content("http://localhost/MY_VD/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(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-10.2.16.914.html"))
            // Strongly typed ReportSource - TypeReportSource or UriReportSource.
            .ReportSource(new UriReportSource() { Uri = "myreport.trdp" })
            // Specifies whether the viewer is in interactive or print preview mode.
            // PrintPreview - 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 with no paging. Additionally interactivity is enabled.
            .ViewMode(ViewMode.Interactive)
            // Sets the scale mode of the viewer.
            // Three modes exist currently:
            // FitPage - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
            // FitPageWidth - 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(ScaleMode.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)
            // Sets the print mode of the viewer.
            .PrintMode(PrintMode.AutoSelect)
            .TemplateUrl("http://localhost/MY_VD/ReportViewer/templates/telerikReportViewerTemplate.html")
    )


  2. Stef
    Admin
    Stef avatar
    3041 posts

    Posted 03 Nov Link to this post

    Hello Michael,

    The viewer's HTML template and the corresponding CSS and icons font resources are not loaded correctly on the page.

    Please test if using the default HTML template works correctly - remove the TemplateUrl setting, the HTML will be requested from the Reporting REST service. Then check if the customized HTML template is loaded correctly and if it contains links to the viewer's CSS and icons font. Compare the customized HTML with the content of default HTML template under [install_folder]\Telerik\Reporting R3 2016\Html5\ReportViewer\templates.

    The recommended troubleshooting approach for the HTML5 Viewer is to use Fiddler or other proxy tool to check the requests, their responses and statuses. With Fiddler, information about requests and responses content can be seen in Fiddler - Inspectors - Request/Response - Raw tabs. This will let you check requests to the Reporting REST service and if the URLs are correct, if relative paths are resolved correctly.

    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
  3. DevCraft banner
Back to Top