[WD19] Trap the result of reading-process of a report

Startbeitrag von Stefan Bentvelsen am 12.03.2015 08:44

Hi all,

how (and where) can I trap the result of the reading process of a report ?

The help says:
Note: This code returns True if there are still records to print and False if there is no record to print.

So can I trap this result so I can substitute the page header block before the next page ? Because the page footer doesn't fit on the page anymore and the page header must be substituted by another block with less controls.

Thank you for any tips and suggestions.

Antworten:

Hi Stefan,
afaik the printing process is a sequential process. So when the footer is about to be printed, the header of that same page is already rendered. You can't change it anymore.

So you need info at the time the header itself is printed. The only way to do so is looping through all records in the opening section of the report or even outside the report before it is started. And then gather your information like the number of records. Use this info then to change the header-height at the right moment, before it is printed.

I sometimes use code like this in the opening section of reports, based on queries.

FOR EACH MyReport..SourceName
... your code i.e.
Trace({MyReport..SourceName + ".CustomerName"})
END
HReadFirst(MyReport..SourceName)

von Arie - am 12.03.2015 20:11
Hi Arie,

thanks for your tip. I will try that for sure.
But I still don't understand the note in the helpfile about the result of the reading-process.

von Stefan Bentvelsen - am 13.03.2015 07:49
Stefan,

I think it is used when doing a programmed read. And tell the report engine another new record has been read (true) or let it know there are no more records (false), after which the end-section is printed and the report is done.

von Arie - am 13.03.2015 08:03
Hi Arie,

it works indeed, but there should have been a more simple way.
Thanks anyway.

von Stefan Bentvelsen - am 17.03.2015 14:47
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.