Passing Params from Angular to .NET Core

Stimulsoft Dashboards.WEB discussion
Post Reply
amayorquin
Posts: 1
Joined: Wed Jun 30, 2021 2:56 pm

Passing Params from Angular to .NET Core

Post by amayorquin »

Hello,

I am using Angular Report viewer. I want to know if there is a way to pass parameters from the angular component to the actions in .NET, so that I can use them in the report.

I tried using the properties options, and I can get that value in the action but it seems it is encrypted:

Code: Select all

 <stimulsoft-viewer-angular
               [requestUrl]="'http://localhost:53129/Viewer/{action}'"
               [action]="'InitViewer'"
               [properties]="{'id':999}"
               [height]="'600px'"
               [width]="'100%'"
 ></stimulsoft-viewer-angular>
and in the .NET Action I'm trying to read it in this way:

Code: Select all

  [HttpPost]
        public IActionResult InitViewer()
        {
            var requestParams = StiAngularViewer.GetRequestParams(this);
            var properties = requestParams.HttpContext.Request.Params.GetValues("properties")
            
            var options = new StiAngularViewerOptions();
            options.Actions.GetReport = "GetReport";
            options.Actions.ViewerEvent = "ViewerEvent";
            options.Actions.ExportReport = "ExportReport";
            options.Appearance.ScrollbarsMode = true;

            return StiAngularViewer.ViewerDataResult(requestParams, options);
        }
The value I'm getting is something like this: eyJpZCI6OTk5fQ==

Is that the correct way to pass parameter to the .NET actions? or there is another way?

And I have the same question for Angular Report Designer, due there is no documentation about Angular Designer in your page.
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Passing Params from Angular to .NET Core

Post by Lech Kulikowski »

Hello,

Please check the following article:
https://www.stimulsoft.com/en/documenta ... meters.htm

Thank you.
Post Reply