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

Telerik report viewer MVC not working when deployed on IIS

7 Answers 993 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
muhammed
Top achievements
Rank 1
muhammed asked on 19 Mar 2018, 02:54 PM

Dear Support team,

I am trying view to Telerik report on the server. On my local machine everything works fine but  when i deploy it on the server it says 

Error creating a report instance and google console log I see it as 500(internal server error) missing parameters and instances.

Please provide immediate assistance

 

 

7 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 22 Mar 2018, 08:05 AM
Hello Muhammed,

The error message indicates that the viewer's ReportSource might be not valid. As it seems that you use a TypeReportSource, its TypeName property takes a string which should be a valid assembly-qualified name of the report.

To make sure that the string set as TypeReportSource.TypeName is correct you can use Type.AssemblyQualifiedName Property and set the report source as following:
$("#reportViewer1")
    .telerik_ReportViewer({
        serviceUrl: "/api/reports/",
        reportSource: {
          // for example "<namespace>.<reportClassName>, <assemblyName>".
          report: "Telerik.Reporting.Examples.CSharp.ProductCatalog, CSharp.ReportLibrary",
          parameters: { }
        }
});

In case you have a custom report resolver - Handling errors occurring in a Custom Resolver used by a Reporting REST Service KB article would be helpful to add error handling.

Use Fiddler to check the requests during running the application in Browser. Then you can see the actual Response from the server and the reason for the error. You can also use the browser's console to check which request fails.

Regards,
Silviya
Progress Telerik
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
muhammed
Top achievements
Rank 1
answered on 22 Mar 2018, 01:15 PM

I am able to view the report on through vs2015 and also I am able to view it on local IIS. But When I deploy on windows server I am getting errors 

Note: remove ~/ from service and javascript source 

<!DOCTYPE html>
<head>
    <title>Telerik HTML5 Report Viewer</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <!--kendo.web.min.js or kendo.all.min.js can be used as well instead of the following custom Kendo UI-->
    <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">
        $(document).ready(function () {
            $("#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-10.1.16.615.html',
                    //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: "HMB2BReport.rptCountryListPrint, HMB2BReport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
                        parameters: { qmerchant: "SNTTA02001", qsearchstring: "999", qdeviceinfo: "127.0.0.1 ^ 10.0 ^ Chrome 13.0 ^ 25.3443434, 55.23232323" }
                    },
                    // 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>

 

Please Provide immediate assistance 

0
Silviya
Telerik team
answered on 27 Mar 2018, 06:31 AM
Hi Muhammed,

The provided settings of the viewer seem to be correct. However, we would need to check the implementation of the REST service (ReportsController) in order to provide you more specific suggestions.

Additionally, make sure that the following points are valid:
  1. The reports and the viewer's projects use the same Telerik Reporting version. For the purpose you can run the Upgrade Wizard to verify this;
  2. The reports' project assembly is referenced in the viewer's project;
  3. The assembly qualified name of the report is spelled correctly: <namespace>.<report_name>, <assembly_name> (the name is case sensitive). 
  4. Check the parameters added in the report, and verify the passed at values conform the specified type for each. If you need parameters to have null values, check the AllowNull property of each parameter in the report. For more details check Report Parameters. The parameters values passed from the viewer are mapped to the added report parameters by name.

Details about passing report parameters' values through the HTML5 Report Viewer are available in the How To: Pass values to report parameters article.

To check what is the reason for errors with the HTML5 Report Viewer, you can use Fiddler and check the Raw Response text in the Inspectors tab after selecting the failed request.

In case the issue still persist, send us a sample that reproduces the problem and the log file created by Fiddler (Fiddler>File>Save>All sessions) in a support ticket so we can investigate them further.

Regards,
Silviya
Progress Telerik
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
muhammed
Top achievements
Rank 1
answered on 02 Apr 2018, 03:18 PM

Please do let me know why I am facing this issue the report viewer works fine on my local IIS deployment  once I deploy it on the server I am getting the following issue

 

HTTP/1.1 500 Internal Server Error
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 02 Apr 2018 15:02:02 GMT
Content-Length: 1303
{"message":"An error has occurred.","exceptionMessage":"Invalid report type","exceptionType":"System.ArgumentException","stackTrace":"   at Telerik.Reporting.Processing.TypeReportDocumentResolver.Resolve(IProcessingContext context, TypeReportSource rs)\r\n   at Telerik.Reporting.Processing.ReportDocumentResolver`1.Telerik.Reporting.Processing.IReportDocumentResolver.Resolve(IProcessingContext context, ReportSource rs, Boolean loadParameters)\r\n   at Telerik.Reporting.Processing.ReportDocumentResolver.Bind[T](IProcessingContext context, ReportSource source, Func`2 func)\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.GetParameters(String clientID, String report, Dictionary`2 parameterValues)\r\n   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetParameters(String clientID, ClientReportSource reportSource)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"}

 

0
Silviya
Telerik team
answered on 03 Apr 2018, 02:37 PM
Hello Muhammed,

I've opened a new support ticket where you would be able to send the problematic project in order to investigate it further.
Your ticket ID is: 1160707. Let's continue our discussion there.

Regards,
Silviya
Progress Telerik
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
Naveena
Top achievements
Rank 1
answered on 25 May 2018, 03:40 PM

My report is not loading and it always giving me error Please help me out

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

0
muhammed
Top achievements
Rank 1
answered on 25 May 2018, 04:03 PM
Please check the relative url by adding a  ~/api/reports/resources/templates/telerikReportViewerTemplate-html
Tags
General Discussions
Asked by
muhammed
Top achievements
Rank 1
Answers by
Silviya
Telerik team
muhammed
Top achievements
Rank 1
Naveena
Top achievements
Rank 1
Share this question
or