Set parameter in code

Stimulsoft Reports.JAVA discussion
Post Reply
User avatar
rafaelwithoeft
Posts: 70
Joined: Thu Mar 05, 2015 8:26 pm

Set parameter in code

Post by rafaelwithoeft »

Hello, how i set parameters to report in the code?
Now i have this, but not work...

Code: Select all

report.Compile();
report.dictionary.variables["@sql"] = new StiVariable("@sql", parametros); 
//report["@sql"] = parametros;
report.Render(false);
Best Regards
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Set parameter in code

Post by Alex K. »

Hello,

Please describe your task in more details. Which parameters you are want set - variable, parameters for the query?
Also please clarify which version are you are use?

Thank you.
User avatar
rafaelwithoeft
Posts: 70
Joined: Thu Mar 05, 2015 8:26 pm

Re: Set parameter in code

Post by rafaelwithoeft »

Hello, i'm using Reports.FX for JAVA 2014.3, i want to set the value of variables and parameters to SQL, how i do it? (You make me a sample?)
I have variable named @sql, i want to send the sql to this variable to use in sql.

I have used this code, but not worked

Code: Select all

report.Compile();
report.dictionary.variables["@sql"] = new StiVariable("@sql", parametros); 
//report["sql"] = parametros;
report.Render(false);
Best Regards
Vadim
Posts: 409
Joined: Tue Apr 23, 2013 11:23 am

Re: Set parameter in code

Post by Vadim »

Hello.
For JAVA you can use next code:

Code: Select all

report.getDictionary().getVariables().get(variableName).setValue(value);
report.getVariables().put(variableName, value);
report.Render(false);
rafaelwithoeft wrote:Hello, i'm using Reports.FX for JAVA 2014.3, i want to set the value of variables and parameters to SQL, how i do it? (You make me a sample?)
I have variable named @sql, i want to send the sql to this variable to use in sql.

I have used this code, but not worked

Code: Select all

report.Compile();
report.dictionary.variables["@sql"] = new StiVariable("@sql", parametros); 
//report["sql"] = parametros;
report.Render(false);
Best Regards
User avatar
rafaelwithoeft
Posts: 70
Joined: Thu Mar 05, 2015 8:26 pm

Re: Set parameter in code

Post by rafaelwithoeft »

Thank you! It Worked!
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Re: Set parameter in code

Post by Andrew »

Hello,

Great!
We are always glad to help you!
Post Reply