Send parameters for query

Stimulsoft BI Server discussion
Post Reply
Vid4259
Posts: 2
Joined: Sun May 15, 2022 6:35 am

Send parameters for query

Post by Vid4259 »

Hello
I have the following script in which the parameter must be sent by the user.
I have designed as follows
Image

On the client side, in the snapshot section, I want to send the parameters to the service side. Anything I do will not be sent.

Code: Select all

var reportKey = '9b4c36de43f544fca9279754dd6eb35c';
		var snapshotKey = resultCreateSnapshot.ResultItems[0].Key;

		// Run report to the snapshot
		var req_runReport = new XMLHttpRequest();
		var vv='64'
		req_runReport.open('PUT', 'http://192.168.76.12:40010/1/reporttemplates/' + reportKey + '/run', false);
		req_runReport.setRequestHeader("x-sti-SessionKey", sessionKey);
		req_runReport.setRequestHeader("x-sti-DestinationItemKey", snapshotKey);

        var event1 ={'code':vv };
        event1 = JSON.stringify(event1);

        req_runReport.send(event1);
        var data = JSON.parse(req_runReport.responseText);
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Send parameters for query

Post by Lech Kulikowski »

Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
Vid4259
Posts: 2
Joined: Sun May 15, 2022 6:35 am

Re: Send parameters for query

Post by Vid4259 »

Hello
I was able to find a solution to this issue through the following

Code: Select all


var reportKey = '9b4c36de43f544fca9279754dd6eb35c';
		var snapshotKey = resultCreateSnapshot.ResultItems[0].Key;

		// Run report to the snapshot
		var req_runReport = new XMLHttpRequest();
		 
		req_runReport.open('PUT', 'http://192.168.76.12:40010/1/reporttemplates/' + reportKey + '/run', false);
		req_runReport.setRequestHeader("x-sti-SessionKey", sessionKey);
		req_runReport.setRequestHeader("x-sti-DestinationItemKey", snapshotKey);
	 var _params =
            {"Parameters": [
                    {Ident: "Single", Name: "code", Value: "64", Type: "string"}
                   
                    ]};
                    
        var params = JSON.stringify(_params);
         req_runReport.send(params);
        var data = JSON.parse(req_runReport.responseText);
        
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Send parameters for query

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply