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

Report works locally but not when deployed to iis

1 Answer 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Navatha
Top achievements
Rank 1
Navatha asked on 20 Dec 2016, 08:42 PM

Hi Team,

I tried to deploy htmlreport viewer to iis and when i browse for 'htmlreportviewer.asp' page.It throws an error 'jQuery undefined'.

Not sure on why the jQuery is not loading eventhough the references are pointed right.Below is my htmlreportviewer asp page

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Telerik HTML5 Report Viewer</title>
    
    <!--<script src="../js/jquery-1.9.1.min.js"></script>
    <link href="../css/kendo.common.min.css" rel="stylesheet" />
    <link href="../css/kendo.blueopal.min.css" rel="stylesheet" />
    <script src="../js/kendo.subset.2015.3.930.min.js"></script>
    <script src="../js/telerikReportViewer-10.1.16.615.min.js"></script>-->


    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <script src="../ReportViewer/js/jquery-1.9.1.min.js"></script>
    <link href="css/kendo.common.min.css" rel="stylesheet" />
    <link href="css/kendo.blueopal.min.css" rel="stylesheet" />
    <script src="../ReportViewer/js/kendo.subset.2015.3.930.min.js"></script>
    <script src="../ReportViewer/js/telerikReportViewer-10.1.16.615.min.js"></script>

    

  <style>
        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>
</head>
<body>

    <div id="reportViewer1">
        loading...
    </div>

    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#reportViewer1")
                .telerik_ReportViewer({

                    // 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: "api/reports/",

                    // The URL for custom 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: '/ReportViewer/templates/telerikReportViewerTemplate',

                    //ReportSource - report description
                    reportSource: {
                        // The report can be set to a report file name (trdx report definition) 
                        // or CLR type name (report class definition).
                        report: "WealthTrackerReporting.Report1, WealthTrackerReporting",
                    },

                    // 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 without paging. Additionally interactivity is enabled.
                    viewMode: telerikReportViewer.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: telerikReportViewer.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,

                    ready: function () {
                        //this.refreshReport();
                    },
                });
        });
    </script>

</body>
</html>

 

Attached the project structure that is on iis. Please suggest.

 

Thanks,

Navatha.

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 21 Dec 2016, 10:13 AM
Hi Navatha,

The error indicates the jQuery is not loaded on the page or it is loaded too late. Please assure that jQuery is loaded before any other JS file on the page, and before creating the viewer object.

Also check the relative paths and if they are resolved correctly based on the hosting and the project structure. 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.
Relative paths may need adjustment depending on how the application is hosted -ASP.NET Web Project Paths MSDN article.

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