My own submit button

Stimulsoft Reports.JS discussion
Post Reply
ga6riel
Posts: 10
Joined: Mon May 13, 2019 1:58 pm

My own submit button

Post by ga6riel »

Hello,

I want to hide the variables and the original "Submit" button (in the red retangle below) from the user and use my own variable fields and my own "Submit" button (the blue button with the red arrow).

I had no problem to add, edit and remove variables by code, but I can't simulate the action "Submit" of the original button on my own button...

How can I do that in JavaScript?

Image
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: My own submit button

Post by Lech Kulikowski »

Hello,

The following codes are called when submit is clicked:

Code: Select all

jsStiWebViewer1.reportParams.editableParameters = null;
if (jsStiWebViewer1.reportParams.type == "Report") jsStiWebViewer1.reportParams.pageNumber = 0;
jsStiWebViewer1.postInteraction({ action: "Variables", variables: jsStiWebViewer1.controls.parametersPanel.getParametersValues() });
In that code, you should change getParametersValues with your variables.

Thank you.
Attachments
photo_2019-08-23_09-59-10.jpg
photo_2019-08-23_09-59-10.jpg (44.47 KiB) Viewed 1836 times
ianwelsh
Posts: 19
Joined: Mon Sep 25, 2017 1:54 pm

Re: My own submit button

Post by ianwelsh »

ga6riel - would you mind sharing your final html + js addition for your custom submit button?

Any thoughts on how you could put your button below the parameters panel and above the report?
ga6riel
Posts: 10
Joined: Mon May 13, 2019 1:58 pm

Re: My own submit button

Post by ga6riel »

Lech Kulikowski wrote: Fri Aug 23, 2019 7:53 am Hello,

The following codes are called when submit is clicked:

Code: Select all

jsStiWebViewer1.reportParams.editableParameters = null;
if (jsStiWebViewer1.reportParams.type == "Report") jsStiWebViewer1.reportParams.pageNumber = 0;
jsStiWebViewer1.postInteraction({ action: "Variables", variables: jsStiWebViewer1.controls.parametersPanel.getParametersValues() });
In that code, you should change getParametersValues with your variables.

Thank you.
Hello,

Two questions:

1) What class is instantiated in "jsStiWebViewer1"?

2) I didn't understand how I change getParametersValues with my variables.
For now I have two variables (a String List named "breeds" and a datetime named "collDay").
Can you show me what I need to change in the code above?

Thank you.
ga6riel
Posts: 10
Joined: Mon May 13, 2019 1:58 pm

Re: My own submit button

Post by ga6riel »

ianwelsh wrote: Tue Aug 27, 2019 3:00 pm ga6riel - would you mind sharing your final html + js addition for your custom submit button?
Still not working properly for me, sorry.
ianwelsh wrote: Tue Aug 27, 2019 3:00 pm Any thoughts on how you could put your button below the parameters panel and above the report?
I don't know if it's possible... I'm doing my own parameters panel as well.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: My own submit button

Post by Lech Kulikowski »

Hello,

Please check sample in the attachment.

Thank you.
Attachments
CustomSubmitButton.zip
(414.94 KiB) Downloaded 193 times
Post Reply