Posted 24 March 2020, 6:56 am EST - Updated 2 October 2022, 11:18 pm EST
I’ve run into an issue getting reports to work with the report viewer and a React/.Net Core stack.
In our React component, we call:
let viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#client-report',
reportID: 'clients.rdlx',
reportService: {
url: url,
securityToken: authHeader().Authorization
}
});
viewer.openReport();
Everything appears to be returned to the browser correctly:
Json:
The core logs show that the middleware handed it correctly:
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 OPTIONS https://localhost:44313/api/reporting/reports/clients.rdlx/info
dbug: Microsoft.AspNetCore.Routing.RouteConstraintMatcher[1]
Route value '(null)' with key 'httpMethod' did not match the constraint 'Microsoft.AspNetCore.Routing.Constraints.HttpMethodRouteConstraint'
dbug: Microsoft.AspNetCore.Builder.RouterMiddleware[1]
Request did not match any routes
dbug: Microsoft.AspNetCore.Routing.Matching.DfaMatcher[1000]
No candidates found for the request path '/api/reporting/reports/clients.rdlx/info'
dbug: Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware[2]
Request did not match any endpoints
dbug: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[2]
The request has an origin header: 'http://localhost:3002'.
info: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[4]
CORS policy execution successful.
dbug: Microsoft.AspNetCore.Cors.Infrastructure.CorsService[1]
The request is a preflight request.
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
Connection id "0HLUG52PPNMI2" completed keep alive response.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 48.6984ms 204
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 GET https://localhost:44313/api/reporting/reports/clients.rdlx/info
dbug: Microsoft.AspNetCore.Routing.RouteBase[1]
Request successfully matched the route with name '(null)' and template '/api/reporting/reports/{reportId}/info'
dbug: Microsoft.AspNetCore.Server.Kestrel[9]
Anyone experienced this? In the basic non-react app it works fine!