Db2 Tools for z/OS

 View Only

Conditional Formatting In QMF Z Client

By Shashank Sonavane posted Wed August 14, 2024 06:57 AM

  

Introduction: Conditional Formatting is a newly introduced feature within the form suite. Its primary objective is to enhance the readability of reports by highlighting specific rows or cell data based on predefined conditions. This feature significantly improves the usability of reports, especially when dealing with large datasets. It ensures that data of particular interest or requiring attention is easily identified upon inspection.

Applying Conditional Formatting: To apply conditional formatting, users can define various formatting parameters such as alignment, foreground color and edit code. These parameters dictate how cell data will appear when the specified condition is met. By leveraging these settings, users can effectively emphasize critical information within their reports, ensuring that important insights are readily discernible.

Example: Let's consider an example to understand how this feature operates and its impact. Below is a screenshot displaying data from the World Census of 2021.


Executing the "show form" command on this result set opens a form window with multiple screens and numerous options available for generating the report.

For now, our focus will be solely on the conditional formatting panel. Clicking on the "View" menu option will bring up a popup window as shown in the screenshot below. You can locate the conditional formatting panel labelled as "CNDLFormat" positioned at number 5 within the menu.


Select option 5, and the following screen will appear.


Understanding CNDLFormat Screen Fields:

·  ID: Formatting ID, an incremental numeric value.

·  Condition ID-Name: On right-clicking this field, the user can see the available conditions set on the conditions panel with combinations of condition name and actual condition.

·  Column Num: Select the column number from the data whose cell data formatting will be changed when the condition becomes true.

·  Align: Select the alignment of cell data which will be applied when the condition becomes true.

·  Edit: Select the edit code from the list which will be applied when the condition becomes true for cell data.

·  Foreground Color: Select the color from the list which will be applied when the condition becomes true for cell data.

Setting Conditions:

Consider the above data of the World Census 2021 which has columns like Density, Female Ratio, Total Population, and Year.

We want to highlight high-density areas, low-density areas, and low female ratios. For this, we need to first set appropriate conditions on the conditions panel:

  • High density: Set the condition as if the cell data value is greater than 5000 in the Density column.
  • Low density: Set the condition as if the cell data value is smaller than 100 in the Density column.
  • Low female ratio: Set the condition as if the cell data value is smaller than 95 in the Female Ratio column.


Now, go to the CNDLFormat panel by pressing F5, which is a pre-configured shortcut key for the CNDLFormat panel. The same F5 key is also configured to go to the Conditions panel as well. Right-click on the Condition ID-Name text area, and a list of inserted conditions will be shown with the combination of Condition Name and the actual set condition. This popup provides a clear idea about set conditions and makes it easy to choose the right condition.

Set the column number whose cell data formatting needs to be changed on the condition.


Similarly, right-clicking on the Align text area will show available alignment options.


Users can choose to change the Edit Code to modify the formatting of the cell data. Many edit codes are available across the QMF products, and the same list will appear here as well. To understand their behavior, refer to the documentation.


Right-click on the Foreground Color text area, and there are 7 colors available to change the cell data or font color.


Example Formatting Options:

For this example, the following formatting options are selected, which will be applied to the requested column cell data once the condition is met.


Upon pressing F12, the report is generated and we can see the formatted cell data.


However, in the region column, the full text of the region is not shown due to the limited width of the column. To display the full text, go to the form and change the edit code of IDs 4 and 5 on the CNDLFormat panel to CW so the full text of the region will be displayed.


Now we can see the CW formatting has got applied on right cell data, allowing us to read the report more effectively.


The same report, with same formatting, can be exported and emailed as both PDF and HTML files.

HTML:


PDF:



#Db2Toolsforz/OS
0 comments
7 views

Permalink