How To: Display Rows Returned from Query

You can create labels to display the number of rows returned from a query and displayed on the screen.

When a query is executed against the database in runtime, there is a defined number of rows that can be returned and displayed on the screen.  This number is first determined by the Max Number of Rows property for the database block.  If that value is zero, then the Default Screen Row Limit property for the Repository Configuration is used.  This value includes any new rows defined in the Num New Rows property for the database block.

You can tell whether or not the number of rows returned has exceeded that number by using the $$ENTITY.LIMITED$$ reference.  If the number of rows returned by the query exceeds the maximum number of rows that the screen allows to be displayed, the value of this reference will equal Y.  

In addition, the number of rows returned by the query is stored and can be accessed by the $$BLOCK,XEPHR_ROW_COUNT$$ reference.

Displaying Rows Returned for Queries

  1. In the Xephr Explorer, expand the desired entity, and in the block in which you want this information displayed, add a label.

  2. Once the label has been created, press the [Save] button in the Main Toolbar.

  3. Display the property sheet for the label.

  4. In the Contents property, enter the Xephr row count reference and any text you want displayed, as follows.  Be sure to replace BLOCK in the following example with the actual block name.

    $$BLOCK.XEPHR_ROW_COUNT$$ rows returned.

  5. Press the [Save] button in the Main Toolbar.

Displaying Rows Returned for Queries Based on the Maximum Number Allowed

You may wish to display different text depending on whether or not the query returned more records than the maximum number allowed for the block.  You can do this using the Show If and Hide If properties for the label.

  1. In the Xephr Explorer, expand the desired entity, and in the block in which you want this information displayed, add two labels.  

    One of these labels will be displayed when the number of rows returned exceeds the maximum for the block and the other will be displayed when the number of rows returned is less than or equal to the maximum number allowed.  In the following example, these labels will be called EXCEEDED and COUNT respectively.

  2. Once the labels have been created, press the [Save] button in the Main Toolbar.

  3. Display the property sheet for the EXCEEDED label.  This label will be displayed when the row count returned is greater than the maximum allowed for the block.

  4. In the Contents property, enter the Xephr row count reference and any text you want displayed, as follows.  Be sure to replace BLOCK in the following example with the actual block name.

    $$BLOCK.XEPHR_ROW_COUNT$$ rows returned.  This number exceeds the maximum allowed for this query.  Please enter additional search criteria to restrict your results.

  5. In the Show If property, enter the Xephr limited reference comparison as follows.  Be sure to replace ENTITY in the following example with the actual entity name.

    $$ENTITY:LIMITED$$ == 'Y'

  6. Display the property sheet for the EXCEEDED label.  This label will be displayed when the row count returned is less than or equal to the maximum allowed for the block.

  7. In the Contents property, enter the Xephr row count reference and any text you want displayed, as follows.  Be sure to replace BLOCK in the following example with the actual block name.

    $$BLOCK.XEPHR_ROW_COUNT$$ rows returned.

  8. In the Hide If property, enter the Xephr limited reference comparison as follows.  Be sure to replace ENTITY in the following example with the actual entity name.

    $$ENTITY:LIMITED$$ == 'Y'

  9. Press the [Save] button in the Main Toolbar.