Some questions

Stimulsoft Reports.PHP discussion
Post Reply
tony.tomov
Posts: 72
Joined: Mon Jun 07, 2010 2:39 am

Some questions

Post 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
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Some questions

Post 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.
tony.tomov
Posts: 72
Joined: Mon Jun 07, 2010 2:39 am

Some questions

Post 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
tony.tomov
Posts: 72
Joined: Mon Jun 07, 2010 2:39 am

Some questions

Post 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
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Some questions

Post 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.

Attachments
913.img.png
913.img.png (44.06 KiB) Viewed 5029 times
tony.tomov
Posts: 72
Joined: Mon Jun 07, 2010 2:39 am

Some questions

Post 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
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Some questions

Post 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.
Ashraf Jebreel
Posts: 3
Joined: Wed Dec 26, 2012 11:35 am

Re: Some questions

Post 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.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Some questions

Post 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.
Post Reply