Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Skipping Records Advice

edited March 2002 in General
Greetings!

I am building a printout routine that requires that each record be validated
and updated at run-time. If a record is flagged as "Do Not Print", then the
records print status is updated and the record is not printed. If it is not
so flagged, it is printed and then updated.

I have built my process using dm0116.pas as a guide to the type of thing
that I need. And, as long as I have one valid, no flag record in the data
set, then I get a useable printout.

The problem is when none of the records in the data set are valid for
printing. I understand (sorta) what's going on here; the report engine has,
on one hand, a data set with records and, on the other hand, a page request
itching to be generated.

What I was hoping is that, once all of the record skipping was done, that
the report generator would magically assume that there was no data if all of
the records were skipped, and the "No Data Behavior" goodies would occur.
But, sensibly enough, the report engine says, "Well, I have data and I gotta
print something." So it prints at least one record (all of my tests point to
the first record).

Preprocessing is not an option because user has the option to override the
flag and print the record anyway, and because of the potential network
traffic involved with building a temp table of potentially 10k+ records. The
records need to be flagged as having been printed (even having been
reprinted!). This is why these invalid records cannot be filtered from the
data set. I am using the TppDetailBand.AfterPrint to set that status for
printed records. Invalid records get updated just before they are skipped.

I would like to maintain the processing structure as I've described, but am
willing to try out any useful options. I am specifically looking for a way
to NOT print a record when the all of the records are invalid, finding this
out only after they've all been validated. What I want to do is imitate the
"No Data Behavior" behavior when all of the records are invalid.

My setup: PIII, Win98se, Delphi 5, RBPro 6.03. Thank you for your attention!

Comments

This discussion has been closed.