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

No 'Access-Control-Allow-Origin' header is present on the requested resource.

2 Answers 1150 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Raul
Top achievements
Rank 1
Raul asked on 25 Jul 2018, 06:00 PM

I have the next service in angular, 

<tr-viewer 
    [containerStyle]="viewerContainerStyle"
    [serviceUrl]="'http://localhost:21294/api/reports'"
    [reportSource]="{
        report: 'Product Catalog.trdp',
        parameters: {}
    }"
    [viewMode]="'INTERACTIVE'"
    [scaleMode]="'SPECIFIC'"
    [scale]="1.0">
</tr-viewer> 

I have my app in .NET whit my report Product Catalog.trdp,

and i have the next errors.

 

 

2 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 26 Jul 2018, 01:16 PM
Hello Raul,

You've asked the same question at Error loading the report viewer's templates forum thread. However, I will post my answer here too:

"Please note that enabling CORS configuration have to be utilized in the REST Service project, not in Angular application. For more information, please refer to Enable CORS and Enabling Cross-Origin Requests in ASP.NET Web API 2."

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
alexa
Top achievements
Rank 1
Iron
answered on 10 Aug 2021, 07:26 AM
Access-Control-Allow-Origin is a CORS (Cross-Origin Resource Sharing) header. The error you get is due to the CORS standard, which sets some restrictions on how JavaScript can perform ajax requests. 

When Site A tries to fetch content from Site B, Site B can send an Access-Control-Allow-Origin response header to tell the browser that the content of this page is accessible to certain origins.  By default, Site B's pages are not accessible to any other origin; using the Access-Control-Allow-Origin header opens a door for cross-origin access by specific requesting origins.

For each resource/page that Site B wants to make accessible to Site A, Site B should serve its pages with the response header:

Access-Control-Allow-Origin: http://siteA.com




Tags
Report Designer (standalone)
Asked by
Raul
Top achievements
Rank 1
Answers by
Silviya
Telerik team
alexa
Top achievements
Rank 1
Iron
Share this question
or