Unable to get report parameters

4 Answers 1557 Views
General Discussions
Andrew
Top achievements
Rank 1
Andrew asked on 08 May 2017, 01:22 PM

Hi,

I have a created a .NET Core application and I have added the Telerik reporting controller as detailed in: http://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

It runs fine when I am using external tdrp reports. 

However I am keen to create a report library and use CLR type names.

Unfortunately I am getting the follow error when trying to view the report:

"Unable to get report parameters.
undefinedReport 'Aliaxis.ReportLibrary.Report1%2C%20Aliaxis.ReportLibrary' cannot be resolved."

 

My viewer report source is set as below :-

                    //ReportSource - report description
                    reportSource: { 
                        // The report can be set to a report file name
                        // or CLR type name (report class definition).
                        //report: "test.trdp",
                        report: "Aliaxis.ReportLibrary.Report1, Aliaxis.ReportLibrary",
 
                        // Parameters name value dictionary
                        parameters: {}
                    }

 

Report 1 is a blank report with a textbox in the center. Its namespace/class name is :-

 

namespace Aliaxis.ReportLibrary
{
    partial class Report1

 

Any advice on why I can't get the report to display and am getting this error?

Kind Regards,

Tom

 

Andrew
Top achievements
Rank 1
commented on 08 May 2017, 01:31 PM

I ran fiddler and this is the response I received if it helps:

 

400
{"Message":"","ExceptionMessage":"Report 'Aliaxis.ReportLibrary.Report1%2C%20Aliaxis.ReportLibrary' cannot be resolved.","ExceptionType":"Telerik.Reporting.Services.Engine.InvalidReportException","StackTrace":"   at Telerik.Reporting.Services.Engine.ReportEngine.ResolveReportSource(String report)\r\n   at Telerik.Reporting.Services.Engine.ReportEngine.GetParameters(String clientID, String report, Dictionary`2 parameterValues)\r\n   at Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.GetParameters(String clientID, ClientReportSource reportSource)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__27.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mv
208
c.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__25.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()"}
0

Nick
Top achievements
Rank 1
commented on 13 May 2019, 09:57 AM

I am getting the exact same error in my HTML 5 viewer, what is the reason for this? seems to happen in many projects when using the latest dll. Code and error below

 

Viewer Error

Unable to get report parameters.
Report 'ReportLibrary.AccountsReport%2C%20ReportLibrary' cannot be resolved.

Browser Console error
Failed to load resource: the server responded with a status of 404 ()
AccountsReport.html:1 Uncaught (in promise) Error shown. Throwing promises chain stop error.

Report API Code

 public class ReportsController : ReportsControllerBase
    {
        static ReportServiceConfiguration configurationInstance;

        static ReportsController()
        {
            //This is the folder that contains the XML (trdx) report definitions
            //In this case this is the app folder
            var reportsPath = HttpContext.Current.Server.MapPath("~/");

            //Add resolver for trdx report definitions,
            //then add resolver for class report definitions as fallback resolver;
            //finally create the resolver and use it in the ReportServiceConfiguration instance.
            var resolver = new ReportFileResolver(reportsPath)
                .AddFallbackResolver(new ReportTypeResolver());

            //Setup the ReportServiceConfiguration
            configurationInstance = new ReportServiceConfiguration
            {
                HostAppId = "MvcApp",
                Storage = new FileStorage(),
                ReportResolver = resolver,
                // ReportSharingTimeout = 0,
                // ClientSessionTimeout = 15,
            };
        }

        public ReportsController()
        {
            //Initialize the service configuration
            this.ReportServiceConfiguration = configurationInstance;
        }
    }
Viewer Code
 $(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.
                    //

                    //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: "ReportLibrary.AccountsReport, ReportLibrary"
                    },

                    // 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.PRINT_PREVIEW,

                    // 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();
                    },
                    parameterEditors: [
                   {
                       match: function (parameter) {
                           return parameter.type === "System.DateTime";
                       },
 
                       createEditor: function (placeholder, options) {
                           $(placeholder).html('<input type="datetime"/>');
                           var dateTimePicker = $(placeholder),
                                                parameter,
                                                valueChangedCallback = options.parameterChanged,
                                                dropDownList;
 
 
                           function onChange() {
                               var dtv = this.value();
                               if (null !== dtv) {
                                   dtv = myadjustTimezone(dtv);
                               }
                               valueChangedCallback(parameter, dtv);
                           }
 
                           return {
                               beginEdit: function (param) {
                                   parameter = param;
 
                                   var dt = null;
                                   try {
                                       if (param.value) {
                                           dt = myunadjustTimezone(param.value);
                                       }
                                   } catch (e) {
                                       dt = null;
                                   }
 
                                   $(dateTimePicker).find("input").kendoDateTimePicker({
                                       format: "dd/MM/yyyy",
                                       parseFormats: ["MM/dd/yyyy"],
                                       min: new Date(2010, 0, 1, 1, 0, 0),
                                       max: new Date(2100, 0, 1, 1, 0, 0),
                                       change: onChange,
                                       value: dt
                                   });
 
 
 
                                   dropDownList = $(dateTimePicker).find("input").data("kendoDateTimePicker");
 
                               }
 
                           }
                       }
                   }]
                });
        });

 

Todor
Telerik team
commented on 16 May 2019, 06:56 AM

Hi Nick,

I noticed that you are already discussing the issue in the Support ticket you opened on the same topic. Let's continue resolving the problem there.

Regards,
Todor
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
n/a
Top achievements
Rank 1
commented on 24 Jul 2019, 02:37 PM

Could you please let us know what is the resolution for this issue,

I have the same issue when I use new developed report not sure why the previous developed report are ok but anything I develop new I cannot use in mu aspx pages I get the same error message 

Jonathan
Top achievements
Rank 1
Veteran
commented on 06 Aug 2020, 03:28 PM

having same issue..

What is the solution?

Where should the REPORT reside?

Does the BUILD ACTION need to be what?

 

 

4 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 08 May 2017, 01:41 PM
Apologies, you can ignore this question. I've added .AddFallbackResolver(new ReportTypeResolver()) to my rest api  controller and all seems to be working.
Ricardo
Top achievements
Rank 1
commented on 29 Sep 2017, 03:10 PM

Hi, I have te same problem, but i´m unable to get the report from the api
Katia
Telerik team
commented on 04 Oct 2017, 11:38 AM

Hi Ricardo,

What is the error message you receive in the viewer? We would need to check the settings of the viewer and implementation of the REST service (ReportsController) in order to provide you further suggestions.

Most common issues with HTML5 Viewer and the troubleshooting approaches are provided in HTML5 Viewer Troubleshooting help article.


Regards,
Katia
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
UnstablePixel
Top achievements
Rank 1
commented on 09 May 2019, 11:08 PM

[quote]Andrew said:Apologies, you can ignore this question. I've added .AddFallbackResolver(new ReportTypeResolver()) to my rest api  controller and all seems to be working.[/quote]

where is the REST api controller?

Todor
Telerik team
commented on 10 May 2019, 03:55 PM

Hello UnstablePixel,

The Web API Controller is configured by default in the ReportsController class. For details you may check How To: Add Telerik Reporting REST Web API to Web Application and How To: Implement the ReportsController in an application articles.
The communication between the viewer and the REST Service is explained in HTML5 Report Viewer and Reporting REST services article.

Regards,
Todor
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
n/a
Top achievements
Rank 1
answered on 24 Jul 2019, 02:44 PM
Removed the reference and re-added the reference to report lib dll and this fixed the issue
0
Neli
Telerik team
answered on 07 Aug 2020, 06:48 AM

Hi Jonathan,

I have already responded to a support ticket on the same topic. I will post my answer here too, so other users can also benefit from it. 

Generally, the message means that the report cannot be found in the folder it is been looked for. This path is set in the ReportServiceConfiguration in ConfigureServices method of the Startup.cs file: 

services.TryAddSingleton<IReportServiceConfiguration>(sp =>
    new ReportServiceConfiguration
    {
        ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
        HostAppId = "Html5DemoAppCore",
        Storage = new FileStorage(),
        ReportSourceResolver = new UriReportSourceResolver(
            System.IO.Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "reportPath")),
    });

I'm afraid I can't say why in Azure the report cannot be found. You need to make sure the reports get successfully deployed in the correct folder on the Azure environment. The problem may be related also to permission to access the folder. You can use Fiddler to check for additional information about the failed request. In the console of the browser you can inspect from which folder the report is loaded.

Regards,
Neli
Progress Telerik

AQEEL AHMED
Top achievements
Rank 1
commented on 10 Aug 2020, 04:09 AM

just start using Telerik Reporting for blazor and having same error.  as you have mentioned to check "ReportSourceResolver"

but there is  "ReportSourceResolver" in ReportServiceConfiguration , i am following example as mentioned in document. i am using "ReportResolver" and here is my code .

   services.TryAddSingleton<IReportServiceConfiguration>(sp =>
                new ReportServiceConfiguration
                {
                    ReportingEngineConfiguration = ConfigurationHelper.ResolveConfiguration(sp.GetService<IWebHostEnvironment>()),
                    HostAppId = "ReportingCore3App",
                    Storage = new FileStorage(),
                    ReportResolver =  new ReportFileResolver(System.IO.Path.Combine(sp.GetService<IWebHostEnvironment>().ContentRootPath, "Reports"))
                });

 

as one of the guy in this asking where should be report on client side or API side ? 

 

AQEEL

AQEEL AHMED
Top achievements
Rank 1
commented on 10 Aug 2020, 07:18 AM

i mean there is no "ReportSourceResolver" in ReportServiceConfiguration
0
AQEEL KHAN
Top achievements
Rank 1
Veteran
answered on 10 Aug 2020, 11:46 PM

All good Working now.

.1 clear all nuget cache(s)

.2 remove nuget.telerik.com source

.3 add again telerik package source again

.4 give your user name and password 

search for telerik package , you will see latest packages

in my case designer have different version and package have different

AQEEL

Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
n/a
Top achievements
Rank 1
Neli
Telerik team
AQEEL KHAN
Top achievements
Rank 1
Veteran
Share this question
or