Page 1 of 1

Send parameters for query

Posted: Sun May 15, 2022 6:58 am
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);

Re: Send parameters for query

Posted: Wed May 18, 2022 9:13 pm
by Lech Kulikowski
Hello,

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

Thank you.

Re: Send parameters for query

Posted: Mon Jun 20, 2022 1:36 pm
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);
        

Re: Send parameters for query

Posted: Tue Jun 21, 2022 7:55 am
by Lech Kulikowski
Hello,

Thank you for the information.