Skip to content

New Context for Reports and Webforms with Row Restrictions

Attention

Designers and whoever works with the eLegere's database and reports should read this document to avoid issues.

The inclusion of Row Restrictions in the context that Reports and Webforms receive obliged changes in the backend. These changes affect how Reports and Webforms work.

What the New Context Involves

The new context for Reports and Webforms relies on a system database table to record the Session's Properties and Row Restrictions for the Report's Application. Reports and Webforms created or modified from 2.13-prerelease.4 and onwards must take in account the new context to work properly.

Failure

The changes affects Reports and Webforms created or modified after 2.13-prerelease.4 that employ the application's context. The new context might break the actual Reports and Webforms employing the application's table's context. Please, revise all the Reports and Webforms employing the context to represent data.

Note

This note concerns Reports and Webforms created before 2.13-prerelease.4.

Before 2.13-prerelease.4, a JSON object file in binary format contained all the Properties and filtered values for the reports. Reports and Webforms used to receive this JSON as context.

Warning

From eLegere 2.14, the old context won't work anymore including Reports and Webforms created before 2.13-prerelease.4. The context has changed due to the deprecation of Column Restrictions (Design Mode > Formulas > Create Restrictions) and the inclusion of Row Restrictions.

How the New Context Works

After 2.13-prerelease.4, there are changes in the backend of how eLegere manages the context for Reports and Webforms. In particular, the context for the Reports and Webforms now includes the Row Restrictions.

After 2.13-prerelease.4, an application generates a GUID instead of a JSON in binary format for Reports and Webforms.

The GUID refers the entries on a database table recording the Properties and Row Restrictions for the Master table and Detail tables' context. Each table involved in the Report or Webform has their own entry.

  • The Master table has a separate entry.
  • Each Detail table has its own entry.

The database table has the following references on the eLegere's database:

Schema Table
elegere TBL_APP_SESSIONS

TBL_APP_SESSIONS always exists in the database. TBL_APP_SESSIONS is empty if no user has employed filters and there are no row restrictions.

The table TBL_APP_SESSIONS has the following fields.

Field Description
SessionId The GUID that the Report or Webform module generates (see above)
Query Records the SQL query to filter the data based on the Properties, filters, and restrictions.
TableName The name of the table considered in the Report
SchemaName The name of the table's schema
UserName Email of user who has opened the Report or Webform in the application.
DT_Creation Date when the user has opened the Report or Webform

On TBL_APP_SESSIONS, there is a record for each table involved in the application's Report or Webform (if there is at least a Property and a row restriction). They share the same SessionId field value equal to the GUID.

Info

The Query field on TBL_APP_SESSIONS records the SQL queries for the following elements:

  • For the Master table entry, all the Properties and filters plus the Row Restrictions specific to the Master table.
  • For a Detail table, only the Properties, filters, and restrictions concerning that Detail table.

The Query field enables to recover the data subset directly through a database query.

Row Restrictions

Info

The Row Restrictions specify what rows to display on a table according to certain conditions. You can find the Formula Editor for Row Restrictions in Design Mode > Settings > Restrictions > Row.