READ FIRST: The Column Processing Model for Expression Processing

Modified on Thu, Nov 30, 2023 at 12:13 PM

What is the Column Processing Model?

The 'column processing model' is the way the Genesis ReportWriter fills the "matrix of data" as it processes the report.   This is very important:  it controls what where some data fields must be located in relation to other data fields and what other data field (i.e. 'columns') a individual data field can 'see' - have access to - as it is processed.

Phases of ReportWriter Processing

The ReportWriter processes the 'report definition' to produce 'the output', which can be an Adobe PDF, an Excel spreadsheet, PDF Forms, etc..  It does this in the following very specific order:

  1. Lookup Phase 1: The 'base table' is queried once to get all data from the base table.
  2. Lookup Phase 2: Data is copied into the 'output matrix' column by column, row by row.
  3. As "lookup" columns are found, a query is done to get data for the single cell being populated.   
  4. At the end of the Lookup phase, all data has been extracted from the database and the output matrix has been populated with this data.  No Expressions have been run.
  5. Expression Phase 1:  the output matrix and Report Definition are processed once again to fill in all of the "Expression Phase 1" (i.e. pre-sort) data.
  6. Sorting:  the output matrix is sorted according the sort option selected by the user.
  7. Expression Phase 2: the output matrix and Report Definition are processed for a third time to fill in all of the "Expression Phase 2" (i.e. post =-sort) data.

The "original column processing model" controls the Lookup Phases of the report.  Expression column processing controls the "Expression" ph

The Original Column Processing Model

By 'original' we mean "how it was before Expression Language was added to the ReportWriter".   This is how the initial 'lookup' columns are still built, before Expression Language columns are processed.

  1. A single initial data query is done to extract data from the "base table".
  2. Data is then copied into this 'output matrix' column by column.
  3. When a 'lookup' column is encountered, the query is done for that ONE column and the data copied into its cell in the output matrix.  Because of this sequential way of filing columns, when doing a lookup, columns can ONLY use data in the 'earlier' columns in the row:  the columns to the left of the current column - or higher up in the list on the "Columns" screen of the ReportWriter. The columns to the right of the current column (that is, below the current column on the Columns screen) and all rows below the current row, do not yet exist.

Expression Columns are Ignored at this Point

In this "older" column processing model, Expression Language columns did not exist.  Now that there are Expression Language columns, the older model ignores them!  Expression Language columns are NOT processed in this first "Lookup" phase of processing the report.

Implications for the List of Columns on the ReportWriter's "Columns" Screen

If you examine the list of columns on the Columns screen, each row of the report is created by going DOWN the list of columns, with the leftmost column on the output page corresponding to the top column on the Columns screen.   As processing continues, all of the rows above the current row have been filled in and are potentially visible to the current row.   In the 'current row' being processed, only columns to the left of the current column have been filled in.  Columns to the right of the current column are empty and thus not available yet.   In all rows "below" the current row, nothing has been filled in:  these do not exist yet.

For example:  if there is a column using one or more of the "Student ID", "SchoolYear" or "SchoolCode" columns to do a lookup, these must be "above" the current column on the Columns screen of the ReportWriter.

Expression Language Column Processing

Expression Language Column Processing picks up where the old "Lookup" column processing ended:   There is a 'completed' output matrix of data which is missing only the Expression Columns.

Features Added with Expression Language Processing

A number of features were added with Expressions:

  1. Rows are now numbered, and the ReportWriter can query a row's number in an Expression.
  2. Because the lookup data is now complete, it is possible to examine other rows of the output matrix.   It is now possible to look at:  the row above the current row (with "prevRow") and the row below the current row (with 'nextRow').
  3. Two new "Expression Processing" phases have been added to the ReportWriter:
    1. "Pre-Sort" Expression Processing:  Expressions that are processed without any expectation of sorting having been done.
    2. "Post-Sort" Expression Processing: Expressions that are processed during the 2nd Expression Processing phase when all rows have been sorted into their proper place.

The Sequence of Expression Processing

There are two phases of Expression Processing:  one before the sort and another after the sort.  Each "Expression Phase" is processed in the same way:

  • Each row of the output matrix is traversed from left to right (top down on the Columns screen).   Remember that all columns have now been filled in EXCEPT the Expression columns.
  • When an Expression Column is located, if it should be done in the current phase, it is processed - computed - immediately and its cell filled in.
  • This means that:  During the 1st Expression phase, Expressions columns to the left of the current column meant to be processed in the first phase have been filled in.  Any "second phase" Expression columns to the left of the current column and all Expression Columns to the right have not been filled in yet.
  • During the 1st Expression phase, all "1st phase" Expression columns in the previous row of the output matrix have been filled in.
  • None of the "2nd Phase" Expression columns in the previous row have been filled in.
  • None of the Expression columns in the next row have been filled in.
  • During the 2nd Expression processing phase, all Expression columns in the previous row have been filled in, as have all 1st phase Expression columns in the current row and in the next row.
  • Second phase Expression columns to the left of the current column already been filled in, but:
  • No 2nd phase Expression Columns to the right of the current column or in the next row have been filled in as yet,  Accessing those will give you bad or undefined data.


Because most of the data in the output matrix exists when Expression Processing is done (including both phases of Expression Processing), Expressions can be used in very powerful ways.   This is explained on the various "ReportWriter Techniques" pages.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article