Ticket T694966
Visible to All Users

Devexpress report using Angular, compile error

created 6 years ago

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?

Comments (3)
Yaroslav (DevExpress Support) 6 years ago

    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

    TB TB
    Thomas Booysen 6 years ago

      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

      Yaroslav (DevExpress Support) 6 years ago

        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)

        Answers approved by DevExpress Support

        created 6 years ago (modified 6 years ago)

        I got it working.
        I needed to register the ReportStorageWebExtension with IOC.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.