Supressing Data in Consecutive Rows of a Report

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

Suppressing Data in Consecutive Report Rows


Using the “previous row” capability, it is possible to suppress the printing of a column if the data in the column is the same as it was in the previous row. For example, if you have multiple, consecutive rows of data concerning a single student, it is possible to suppress repetitive information about that student, such as their name, ID, gender, hr, etc., in subsequent rows, so that you are printing only the information that changes from row to row.


${row.studentName == prevRow.studentName ? '' : row.studentName}

or:

${row.studentID== prevRow.studentID? '' : row.studentName}


If you have set up "First Row for a Student" and "Last Row for a Student" as described in the Finding the First and Last Rows for a Student article, instead of doing the above, you can simply use the "First Row for Student" column you created:


           ${ row.FRFS ? '' : row.studentName }


Note that the '' are two single quotes with nothing between them:  this creates "the empty String" or a String of zero length containing no characters.

 

This example will print a student’s name in the first row in which it appears; if it appears in successive rows, it will be replaced by a blank. The “data column” is the studentName column. This extracts the student’s name from the database. The “Print” column contains the expression above – and is the column which is actually printed.


The result is that repeated rows with the same information are replaced with empty cells for each column you have done this for:


Caveat:  The rows must be in the proper order BEFORE sorting. This will not work if the rows must be sorted after the expressions are executed --> You must check the "Evaluate this expression after sorting rows." checkbox for all columns that do this kind of comparison or use one of the "first row for student" or "last row for student" pre-created rows.  

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