RequestUrl from Report Designer not using HTTPS protocol

Stimulsoft Reports.ANGULAR discussion
Post Reply
christianmurata
Posts: 9
Joined: Fri Jul 26, 2024 12:19 pm

RequestUrl from Report Designer not using HTTPS protocol

Post by christianmurata »

Hello, our team is using the stimulsoft-designer-angular component for online report editing.

We're using the component as follows in our Angular app [stimulsoft-designer-angular.png].

These are the versions used:
stimulsoft-designer-angular@2024.3.5
Stimulsoft.Reports.Angular.NetCore@2024.3.5

The component's requestUrl is set to https:// but at a certain point requests are made without the https protocol.

What can I do to ensure that the https protocol is used?

I've attached images of the component definition and the errors.
Attachments
error.png
error.png (127.9 KiB) Viewed 14879 times
success.png
success.png (127.72 KiB) Viewed 14879 times
stimulsoft-designer-angular.png
stimulsoft-designer-angular.png (21.54 KiB) Viewed 14879 times
Vadim
Posts: 409
Joined: Tue Apr 23, 2013 11:23 am

Re: RequestUrl from Report Designer not using HTTPS protocol

Post by Vadim »

Hello

It seems that you configured RouteTemplate in options, please check it
StiAngularDesignerOptions options.Server.RouteTemplate
christianmurata
Posts: 9
Joined: Fri Jul 26, 2024 12:19 pm

Re: RequestUrl from Report Designer not using HTTPS protocol

Post by christianmurata »

Hello!

I haven't used this option on my API. This is how I configure the designer to display a blank report.

Code: Select all

[Route("api/[controller]")]
public class DesignerController : Controller
{        
    [HttpGet]
    public IActionResult Get(string lang, string data)
    {
        var requestParams = StiAngularDesigner.GetRequestParams(this);
        if (requestParams.Action == StiAction.Undefined)
        {
            var options = new StiAngularDesignerOptions();
            options.Height = Unit.Percentage(100);
            options.Dictionary.PermissionDataConnections = StiDesignerPermissions.None;
            options.Dictionary.PermissionDataSources = StiDesignerPermissions.View;
            options.Dictionary.PermissionDataRelations = StiDesignerPermissions.View;
            options.Appearance.Zoom = StiZoomMode.PageWidth;

            options.Localization = lang switch
            {
                "es" => "Localization/es.xml",
                "en" => "Localization/en.xml",
                _ => "Localization/pt-BR.xml"
            };
            return StiAngularDesigner.DesignerDataResult(requestParams, options);
        }
        return StiAngularDesigner.ProcessRequestResult(this);
    }

    [HttpPost]
    public async Task<IActionResult> Post()
    {
        var requestParams = StiAngularDesigner.GetRequestParams(this);
        if (requestParams.ComponentType == StiComponentType.Designer)
            switch (requestParams.Action)
            {
                case StiAction.GetReport: return await GetReport();
                //case StiAction.SaveReport: return await SaveReport(identifier, reqData);
            }
        return StiAngularDesigner.ProcessRequestResult(this);
    }

    public async Task<IActionResult> GetReport()
    {
        var report = StiReport.CreateNewReport();
        return StiAngularDesigner.GetReportResult(this, report);
    }
}
christianmurata
Posts: 9
Joined: Fri Jul 26, 2024 12:19 pm

Re: RequestUrl from Report Designer not using HTTPS protocol

Post by christianmurata »

Hello,

I added the following code to the Get() method.

Code: Select all

this.HttpContext.Request.Scheme = "https";
I also ensured that options.Server.RouteTemplate is null.

Code: Select all

options.Server.RouteTemplate = null;
This worked for me.
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: RequestUrl from Report Designer not using HTTPS protocol

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply