Page 2 of 2

Re: Passing Parameters to SQL

Posted: Thu Apr 28, 2016 6:09 am
by Vadim
Hello.
Can you show screenshot of added category

Re: Passing Parameters to SQL

Posted: Sat Apr 30, 2016 4:16 am
by smartleopard
Vadim wrote:Hello.
Can you show screenshot of added category
Hi,
I've used the code below:

stiReport.getDictionary().getVariables().add(new StiVariable("Var1", "", new StiSystemGuid()));

It adds Category. See the screenshots:
2016-04-30_082920.jpg
2016-04-30_082920.jpg (50.26 KiB) Viewed 6307 times
And when I right click on it and choose Edit:
2016-04-30_083006.jpg
2016-04-30_083006.jpg (24.07 KiB) Viewed 6307 times
I'm using Stimulsoft.For.Java.Flex 2014.3

Thx

Re: Passing Parameters to SQL

Posted: Mon May 02, 2016 10:11 am
by Vadim
Hello.
Did you use your code stiReport.getDictionary().getVariables().add(new StiVariable("Var1", "", new StiSystemGuid()));
with report.getVariables().put("Var1", val);
?

Re: Passing Parameters to SQL

Posted: Tue May 03, 2016 4:51 pm
by smartleopard
Vadim wrote:Hello.
Did you use your code stiReport.getDictionary().getVariables().add(new StiVariable("Var1", "", new StiSystemGuid()));
with report.getVariables().put("Var1", val);
?
Hi,
as far as I understand, the below code works as: first parameter is category name, second one is variable name and the last one is variable type.

Code: Select all

new StiVariable("Var1", "", new StiSystemGuid())
I changed my code as below:

Code: Select all

stiReport.getDictionary().getVariables().add(new StiVariable("Cat1", "Var1", new StiSystemString()))
stiReport.getDictionary().getVariables().get("Var1").setValue("JAVA");
stiReport.getVariables().put("Var1", "JAVA");
but it throws NullPointerException when serializing report before to show in flex designer 2014.3.

Re: Passing Parameters to SQL

Posted: Wed May 04, 2016 6:41 am
by Vadim
Hello.
Now I understand, pelase use next code:

Code: Select all

report.getDictionary().getVariables().add(new StiVariable("", "Var1", StiSystemTypeEnum.SystemString.getSystemType()));

Re: Passing Parameters to SQL

Posted: Thu May 05, 2016 7:40 am
by smartleopard
Vadim wrote:Hello.
Now I understand, pelase use next code:

Code: Select all

report.getDictionary().getVariables().add(new StiVariable("", "Var1", StiSystemTypeEnum.SystemString.getSystemType()));
Hi,
Thanks for your attention and response, Now it works. But there is another question in my mind:
What I must do with a report that has variables which are not requested by user when I click the Preview? By other words, when I select Preview in designer, how i must fill the variables? I mean which method is called when preview is selected that then I can fill the variables?
Thx

Re: Passing Parameters to SQL

Posted: Thu May 05, 2016 10:49 am
by Vadim
Hello.
You can fill variables in RenderReportAction like in webfx sample my.actions.MyRenderReportAction

Re: Passing Parameters to SQL

Posted: Sat May 07, 2016 4:46 pm
by smartleopard
Vadim wrote:Hello.
You can fill variables in RenderReportAction like in webfx sample my.actions.MyRenderReportAction
Hi,
Thanks for your response

Re: Passing Parameters to SQL

Posted: Mon May 09, 2016 5:28 am
by Andrew
Hi,

Glad to help you!

Have a nice day!