List view in TStruct

The List View displays all the transactions entered in a TStruct in a tabular format. To enable or disable List View for a TStruct, set the List View property of TStruct to True or False. If set to True a List View button will be displayed at  runtime.

  • A list view can configured in build mode. To configure list view during development, click Options-> Configure Lview option in the menu bar.
  • In the Select View Columns, the columns to be displayed can be selected. Click Save. This will be the default view.
Configure LView

Configure LView

  • A list view can also be saved as a customized view at runtime. As part of the customized view, the columns, its width, sub total, sort order and search criteria are saved.
List View

List View at runtime

 

  • You can choose the columns that should be displayed in list. You cannot choose columns from 2 different grid DCs.
  • A list view by default provides the following options
  1. Sort
  2. Sub total
  3. Send to XL
  4. Save as XML, HTML, CSV
  5. PrintPreview

The options can be enabled or disabled by the developer when the Tstruct is defined. These options can also be enabled or disabled when responsibilities are defined. This feature can be used to enable/disable options based on user login.

In case of high volume of data, pagination is managed by Axpert. The data is automatically split into smaller number of transactions when read from the database.

You can display sub totals for every group of records in the list. This is done by selecting a key column. The records will be grouped based on the value in the key column. When the list is printed, saved or exported, it is done along with the key column.

The search panel on the top can be used to search for different criteria.

View filters

The records that a user sees can also be controlled using the “ViewFilter” global variable. This is defined in the application properties. The content of this variable will be added to the where clause of the list view SQL. The list view SQL is automatically framed by Axpert to get data from the database.

For example if the application is used by people from different branches. Transactions entered by branch A should not be viewed by branch B. List view brings all records by default. Use a view filter to filter the records based on branch. You can do this by following the steps below

Define an application variable as below:

firesql({sql1}, {select branch from employee where loginname = :username})

mybranch := sqlget({sql1}, {branch})

The firesql function fires the SQL. The SQLGet function gets the value from the branch column in the result of sql1. This is stored to mybranch. In this case it is assumed that the login name is attached to the employee master. This can be used in view filter.

Define a calculated field named “viewfilter” in the TStructs that need to be filtered. The expression for this field should be

{branch=}+quotedstr(mybranch)

The list view SQL for the TStruct is altered as below

Select col1, col2,… from table1 where branch=’Bangalore’