Have any questions?
+44 1234 567 890
Chapter 9. User Variables
9. User Variables
User variables are designed to adapt a report to the needs of the user executing it. By applying user variables, the same report holds a different base data entirety for different users.
We would like to explain user variables based on an example. The employees of an enterprise are distributed to two locations. They shall be given access to the sales figures of the enterprise, however, only to the data relevant for their respective location. You can model this requirement by establishing two separate reports (which are almost identical), and by granting the employees of location A access to the one report and the employees of location B to the other report. But you can also design a single report, and by applying user variables restrict the base data entirety per each executing user. Let us assume the user variable OFFICE was created, and the employees of location A have set it to "A", the employees of location B to "B". Now, you can create a parameter of type User variable for the report and select the variable OFFICE that you have defined before. (In the following example we assume to proceed on the basis of a dynamic list and a relational database.) Now, the query for the report can be designed as follows:
SELECT * FROM SALES WHERE SALES_OFFICE = ${OFFICE}