Hi I want to evaluate a table and print a report with the evaluation results. Cycling through the data-item of the report, I want to test if a particular field of the current record in the dataitem is false or true. If true, the record is stored in a temporary table for use in the OnPostDataItem-trigger. If false, I would like this record to be printed by the report. How can I manage this ? Showoutput doesn’t seem to help me on this one. Thanx Josh
Josh, try the following code in the OnAfterGeT trigger: IF "Particular Field" then BEGIN TmpRecord := DataItemRecord; TmpRecord.PrimaryKey := NewPrimaryKeyValue; TmpRecord.INSERT; CurrReport.SKIP; END;
Hope this helps. Saludos Nils
You wouldn’t even need to set the primary key, and the CurrReport.SKIP is not necessary either. The line to copy the record into Temprecord and the INSERT should be enough.
quote:
You wouldn’t even need to set the primary key, and the CurrReport.SKIP is not necessary either. The line to copy the record into Temprecord and the INSERT should be enough.
Originally posted by DenSter - 2005 Jul 14 : 14:58:21
I would agree for most cases, but you can also use CurrReport.SKIP and PrintOnlyIfDetail in cases like this to make the DataItem think nothing has been printed so that header information isn’t printed if there are no applicable records in the Temporary Table.