Work with Divisions
Developers can use the Division element in their Logi reporting applications to contain and organize groups of elements within a report. The Division element makes working with groups of element in Studio easier and provides the ability to dynamically apply style classes, or to show and hide report sections. This topic discusses the Division element and techniques for its use.
- About the Division Element
- Hiding/Showing Report Sections Using Conditions
- Hiding/Showing Report Sections Using Show Modes
- Hiding/Showing Report Sections Using Security Rights
- Hiding/Showing Report Sections Using Action.Refresh Element
About the Division Element
In Studio, the Division element functions as a "container" for other elements. It's a parent element that can have a wide range of child elements.
The presence of a Division element normally causes a set of HTML <SPAN> tags to be generated when the report is run. However, the element has an attribute that allows <DIV> tags to be generated instead. Generally, the DIV tag is considered a "block" container and SPAN an "in-line" container. A DIV tag also automatically produces a Line Break after it.
You can assign a style class to a Division element and, as a container, that class will affect all of the Division's child elements. For example, a style class that sets a font size can be applied once, to a Division element, and all of the elements the Division contains will also use that font size (unless individually overridden).
Divisions can be also be used as an organizing entity. Report sections, containing any number of elements, can be placed within a Division. Then the Division can be shown or hidden, using dynamic criteria, causing the section to appear or disappear in the report. This provides tremendous flexibility and can be used to reduce the number of report definitions that need to be developed and maintained and can be used to make a report appear differently in different circumstances or for different users.
The Division element's other attributes, Condition, Show Modes, and Security Right ID, which can be used to show and hide the container, are discussed in the following sections.
The Division element also has a Condition attribute, which can also be used to set its visibility (and the visibility of its child elements). As discussed earlier, circumstances may dictate that only certain parts of a report be visible to a user.
This can be achieved by placing elements beneath a Division element, then setting the Division element's Condition attribute accordingly, as shown above. If the Condition attribute value evaluates to True, then the Division and its child elements will be made visible; otherwise they'll be hidden. For more information, see Conditions.
You can also use Show Modes attribute to set Division visibility (and the visibility of its child elements). Under some circumstances, this may be more desirable than using a Condition expression.
This can be achieved by placing elements beneath a Division element, then setting the Division element's Show Modes attribute accordingly, as shown above.
There are built-in Show Modes values available which can be very useful. For example, using the rdBrowser value will cause the division to be seen only when the report is displayed as HTML in a browser; using rdExportPdf will cause the division to be visible only when the report is exported as a PDF. For more information, see Show Modes.
The Division element also has a Security Right ID attribute, which can also be used to set its visibility (and the visibility of its child elements). As mentioned earlier, circumstances may dictate that only certain parts of a report be visible to certain users.
This can be achieved by placing elements beneath a Division element, then setting the Division element's Security Right ID attribute accordingly, as shown above. If Logi Security is enabled and a user's security role has the security right identified in this attribute, then the Division and its child elements will be made visible; otherwise they'll be hidden. For more information, see Introduction to Logi Security.
The Action.Refresh Element element, using AJAX technology, allows you to refresh a portion of a report page instead of the regenerating the entire report page. It can be used, for example, to refresh Division elements and, when used with a Link Parameters element, can pass parameters that can cause divisions to be shown or hidden.
To get the refresh to work properly, you must place the Division element(s) to be refreshed beneath a parent Division element and then make that parent element the target of your Action.Refresh Element element. Do not target the child Division element(s).
In the example shown above, two Division elements have their Condition attributes set so they're displayed based on a Request parameter value. They're both children of the "divParent" element. Clicking the link "lblTest" will refresh "divParent" and pass a parameter value. The two child Division elements will be shown or hidden based on that parameter value.
Tokens may be used in theAction.Refresh Element element's Element ID attribute value.