0
votes

The report groups records by full name. I want to be able to display the first record in each group with a non-blank description field. If all records have a blank description then the last record should be displayed.

So what should appear is the latest comment or blank if no comment has ever been recorded. At present I have the following bits of code added to the report:

Details - Suppress (No-drill down)

shared numbervar count;
if count=1 then false else true

Header

shared numbervar count;
count:=0;

Details

shared numbervar count;
count:=count+1;

This only will display the first record regardless of content. What I need is to add code to suppress the record until a non-blank is found or display the last record if no record is found.

1

1 Answers

0
votes

Suppressing the records with NULL values likely won't work well with your method of counting details records. The reason for this is a suppressed record would still be counted by your formula, which would cause the first record to be suppressed for being NULL, then all records after would be suppressed because the value of your count variable will be greater than 1.

I would recommend that you modify your selection criteria in Select Expert so that the records that contain NULL values are not selected and have no chance to be the first record in each group of your dataset. Try a formula such as the following.

Not IsNull([TABLE.COLUMN])

Where [TABLE.COLUMN] is the column in your dataset that could potentially contain the NULL values. If that doesn't work, you may also need to filter out empty string values as well as NULL values. To do this you would modify the formula like this.

Not IsNull([TABLE.COLUMN]) or [TABLE.COLUMN] = ""