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

Report in asp.net core issue.

2 Answers 729 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Iron
Vincent asked on 29 Jan 2019, 07:16 AM

I install the latest release of reporting (2019 r1). I try put report in my .net core application. I follow the instruction of the reporting document. Add a controller and a viewer page in my application. But I call the webapi, I got a error as follow:

{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at Telerik.Reporting.Services.Engine.ResourcesEngine.GetResource(String folder, String name) in c:\\temp\\reporting\\RBuild-13280\\Reporting_Build\\Source\\Code\\Telerik.Reporting\\Services.Engine\\ResourcesEngine.cs:line 30\r\n at Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.GetResource(String folder, String resourceName) in c:\\temp\\reporting\\RBuild-13280\\Reporting_Build\\Source\\Code\\Telerik.Reporting.Services.AspNetCore.Core\\ReportsControllerBase.Resources.cs:line 92\r\n at lambda_method(Closure , Object , Object[] )\r\n at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)\r\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()\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.InvokeInnerFilterAsync()\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()"}

 

and I access the viewer page. the error as follow:

Cannot access the Reporting REST service. (serviceUrl = '../api/reports/'). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)

 

what can I do.

 

 

 

2 Answers, 1 is accepted

Sort by
0
Vincent
Top achievements
Rank 1
Iron
answered on 29 Jan 2019, 03:40 PM

Not I have the follow error, please help.

 

Unable to get report parameters.
An error has occurred.
Type: Telerik.Reporting.XmlSerialization.Current.ReportSerializable`1[Telerik.Reporting.Report]

 

 

0
Silviya
Telerik team
answered on 31 Jan 2019, 03:20 PM
Hi Vincent,

I'm not sure which documentation article you've followed. If t you are referring to our HTML5 Report Viewer in ASP.NET Core 2 help article to setup pure ASP.NET Core project, please consider that this help was targeting the workaround that we've supported prior to the new functionality in R1 2019. You can refer to the new conceptual documentation article .NET Core Support that explains how to use reports in pure .NET Core application for Windows and Linux platforms.

Telerik Reporting ships with a ready-made ASP.NET Core example that demonstrates how to show the sample reports in an ASP.NET Core application. The example also shows how to inject an appsettings.json configuration file to the controller and how to initialize a WebHostBuilder so it runs under Windows and Linux.

The example can be found in the \Examples\CSharp\Asp.NetCoreDemo sub-folder of the Telerik Reporting installation directory.

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
Tags
General Discussions
Asked by
Vincent
Top achievements
Rank 1
Iron
Answers by
Vincent
Top achievements
Rank 1
Iron
Silviya
Telerik team
Share this question
or