Hi,
I'm using the aspnet zero framework and I want to add the report viewer to the angular side.
I followed the steps in this post: https://www.devexpress.com/Support/Center/Question/Details/T652551/unable-to-fetch-report-design-from-server-side-to-client-side
The moment I add this part: import { DxReportViewerModule } from 'devexpress-reporting-angular', it fails with these compile errors:
ERROR in ./node_modules/@devexpress/analytics-core/dx-analytics-core.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules@devexpress\analytics-core'
ERROR in ./node_modules/devextreme/localization/globalize/date.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules\devextreme\localization\globalize'
ERROR in ./node_modules/devextreme/localization/globalize/core.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules\devextreme\localization\globalize'
ERROR in ./node_modules/devextreme/localization/globalize/number.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules\devextreme\localization\globalize'
ERROR in ./node_modules/devextreme/localization/globalize/date.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize\date' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules\devextreme\localization\globalize'
ERROR in ./node_modules/devextreme/localization/globalize/number.js
Module not found: Error: Can't resolve 'D:\Development\DDD\XFiles_Angular\angular\src\node_modules\globalize\dist\globalize\number' in 'D:\Development\DDD\XFiles_Angular\angular\node_modules\devextreme\localization\globalize'
Any idea as to what I should try?
Hi Thomas,
This globalize issue seems to be very similar to the one we've discussed in the Unable to integrate Document Viewer with Angular 6.0.7. Check this thread as well: Globalize library registration issue in Angular CLI 6 project. If
nothing helps, feel free to share the client side project you have, we'll be happy to look into it (don't forget to remove the pm-modules folder to reduce the target archive size).
Regards,
Yaroslav
Thanks, that worked.
I now have another problem that has to do with CORS.
The aspnet zero has cors set up already but I get this error when I try to open a report:
Access to XMLHttpRequest at 'http://localhost:22742/DXXRDV' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
When I try and change the startup project as suggested here: https://documentation.devexpress.com/XtraReports/400197/Create-End-User-Reporting-Applications/Web-Reporting/JavaScript-Reporting/Document-Viewer/Server-Side-Configuration/Server-Side-Configuration-ASP-NET-Core
then the framework throws a CORS error the moment I try to open any page?
Regards
Hi Thomas,
>>When I try and change the startup project as suggested here…then the framework throws a CORS error the moment I try to open any page
Can you confirm that you're following the right registration order described in the Document Viewer Integration in Angular help topic? In particular, in the Configure method, you're supposed to call app.UseCors() prior to app.UseDevExpressControls() .
>>The aspnet zero has cors set up already but I get this error when I try to open a report:
In this case, please open the network tab of your browser's Developer Tools (F12) and let us know what the response codes of each request are so we can be sure that it's indeed the CORS issue (please make a screenshot)