Page 1 of 1

Some questions

Posted: Mon Apr 11, 2011 6:07 am
by tony.tomov
Hello,
I can not find a way to do some thing. A help from you is greatly appreciated.

1. How can a show/hide a DataBand by condition?
The situation is as follow:
I define a custom variable with check Request from user.The default value is 0
If the value is 0 I want to hide the detail data band to display its data.

If the user put 1 I want to show this detail data.
How to achieve this? It is possible?

2. In some reports I want to have a Dynamic Query (SQL command) based on session variables.
How can I do this? ( I can do this in handler.php, but this is not a good solution - imagine I have 50+ reports )

Thank you

Kind Regards
Tony

Some questions

Posted: Mon Apr 11, 2011 7:00 am
by Vladimir
Hello, Tony
1. How can a show/hide a DataBand by condition?
This can be realized as follows:
1. Please set the condition for the band using the expression with your variable.
2. Uncheck the "Component is Enabled" flag, this will allow to hide the component, if the condition is false.

2. In some reports I want to have a Dynamic Query (SQL command) based on session variables.
Because the Flash is running on the client side, then it does not have access to the session on the server. If your variables are passed in GET or POST request, then they can be used in a SQL query as parameters.

Thank you.

Some questions

Posted: Tue Apr 12, 2011 5:02 am
by tony.tomov
Hello,
1.Please set the condition for the band using the expression with your variable.
Sorry where should I find the condition for the DataBand?

Regards
Tony

Some questions

Posted: Tue Apr 12, 2011 5:06 am
by tony.tomov
Hello,

I see that the Condition is available only in GroupHeader bands, but not in Data Band.
Is this a bug or by design?

Will be good to have it in data band too.

Regards
Tony

Some questions

Posted: Tue Apr 12, 2011 8:35 am
by Vladimir
Hello, Tony

We meant other conditions, they can be called using the Ribbon toolbar (please see the attached image). We also add this property to the Properties Panel in the new version, update will be available today on April, 12.

Thank you.


Some questions

Posted: Thu Apr 14, 2011 3:16 am
by tony.tomov
Hello Vladimir,

1. Works like charm. Thank you.
One more note - in the past we discuss a possibility to show the user defined variables window when the user from some reason click close button.
I do not see such button.
Do you want to implement this?
2. Because the Flash is running on the client side, then it does not have access to the session on the server. If your variables are passed in GET or POST request, then they can be used in a SQL query as parameters.
I do not fully agree with this, since the data, column definitions and etc. are done server side. I have successes to make this to work.
I added a similar function like sti_parse_query_parameters, but for session variables. It work ok.

Kind Regards
Tony

Some questions

Posted: Thu Apr 14, 2011 8:38 am
by Vladimir
Hello, Tony

We have added a new Parameters button on the viewer toolbar, the update will be available in the next prerelease build on April, 19.
I do not fully agree with this, since the data, column definitions and etc. are done server side. I have successes to make this to work.
I added a similar function like sti_parse_query_parameters, but for session variables. It work ok.
PHP is server side, and through it can be access to the session. We had in mind the impossibility of access to the session directly from Flash. In your case, you can pass parameters from the session to POST request when calling the viewer, and use them in the report as variables.

Thank you.

Re: Some questions

Posted: Mon Nov 17, 2014 8:32 am
by Ashraf Jebreel
Hi,
can I have sample of passing session values as variables?
I mean how to define these variables and assign them posted session values in Report Designer.

Re: Some questions

Posted: Tue Nov 18, 2014 11:30 am
by Vladimir
Hello,

For this you should create variables in the report, then set their values in the sti_get_parameter() function in the index.php file.
As the name of the parameter, use the variable name. For example:

Code: Select all

case "Variable1": return $_SESSION['name'];
Thank you.