Ticket T1282656
Visible to All Users

Error with Report Designer when deployed to IIS

created a day ago (modified a day ago)

Good day.

We have the following problem with the report generator when used with Angular and DotNet WebApi:

We have downloaded the Angular & Api projects from https://github.com/DevExpress-Examples/reporting-angular-integrate-report-designer. Compiled and run from VS2022, everything works fine. The report generetor opens the default report and we also can do a "Save as".

But when we deploy on the IIS server (i.e. C:\inetpub\wwwroot\myapi, either dotnet 8, or dotnet 9), and change the host to 'http://localhost/myapi/', then the report designer opens correctly, BUT there is an error on "Save as".

On F12->Console we can see the error "Failed to load resource: the server responded with a status of 404 (Not Found)" /myapi/myapi/DXXRD:1
Which means for some reason the "myapi" is put twice on the uri.

Can you please give us some guidance in what causes the problem and what the solution is?

In order to reproduce, please download the code from the link. Deploy the ServerApp.Server on C:\inetpub\wwwroot\myapi, change the host to 'http://localhost/smartwebapi/' on the Angular Report Designer project, and execute. The report designer opens, but on F12 there is the error message. then try to do a "Save As" and you must have an error message.

Kind regards,
Dimitris

Comments (1)

    The correct is "…change the host to 'http://localhost/myapi/' on the Angular Report Designer project…"

    Answers approved by DevExpress Support

    created a day ago

    Hi Dimitris,

    There are three controllers with the DXXRD, DXXRDV, and DXXQB routes in total (must be already present in your application). There's also the GetDesignerModel action responsible for designer model generation. This is where you define the routes for the controllers above (that is, you configure all designer settings on the server and not on the client). The client will append the path you return there to the specified host. Most likely, the duplicated segment issue lies in routing: you need to adjust the properties we expose according to your deployment configuration. As by default all end points are relative to the current document path, my idea is to try adding a forward slash:

    C#
    [HttpPost("[action]")] public IActionResult GetDesignerModel([FromForm]string reportUrl, [FromServices] IReportDesignerModelBuilder designerModelBuilder, [FromForm] ReportDesignerSettingsBase designerModelSettings) { designerModelBuilder.DesignerUri("/DXRD"); designerModelBuilder.ViewerUri("/DXRDV"); designerModelBuilder.QueryBuilderUri("/DXXQB"); var designerModel = designerModelBuilder.Report(reportUrl).BuildModel(); designerModel.Assign(designerModelSettings); return DesignerModel(designerModel); }

    Let me know if doing this changes anything.

    Regards,
    Yaroslav

      Comments (1)

        Hi Yaroslav,

        I tried that solution before but without any success, but now I notice that there is a typo in "/DXRD". The correct is "/DXXRD". When this is corrected it works!

        So by using the following on GetDesignerModel, the problem is gone.

        designerModelBuilder.DesignerUri("/DXXRD");
        designerModelBuilder.ViewerUri("/DXRDV");
        designerModelBuilder.QueryBuilderUri("/DXXQB");

        Thank you for your kind assistance.

        Regards,
        Dimitris

        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.