Page 1 of 1

Accessing selected values of variables

Posted: Wed Apr 24, 2013 8:58 am
by DHarvey
Hi,

I was looking to access the selected value of a variable either before the StiReport has been compiled or not compiled.

I can currently access the variables by means of using the StiReport.Dictionary but the value set in the Report Preview are not bound
to the value of these in the StiReport.Dictionary.

Example,

I create a variable called "Station".

I bind station to the field "StationName", although the list of variables is populated with the name, when I select the item and try to get that value at run time It does not seem to be bound to the variables.

So really what I need is a way to access the selected value of a variable at run time. Please let this be possible :)

Thanks for your help.

Kind Regards,
David

Re: Accessing selected values of variables

Posted: Wed Apr 24, 2013 9:04 am
by Alex K.
Hello,

Please try to set the ReadOnly property for variable if you uses the datasource in variable expression.

Thank you.

Re: Accessing selected values of variables

Posted: Wed Apr 24, 2013 9:09 am
by DHarvey
Hi,

Sorry I don't think I've explained it clearly.

I want the user to be able to select a value from the list of variables at run time.
I then need a way to access the variable in code when the report has been compiled to gain that value.
This would allow me to build filters etc for the query I plan to use in SQL.

Does that make more sense?

Re: Accessing selected values of variables

Posted: Wed Apr 24, 2013 1:54 pm
by Alex K.
Hello,

Please try to use the "Request From User" variables.
In this case the value of varibales will be requested from user before rendering. Also this values you can use in sql query.

Thank you.