Update dataset while traversing in report

Hi

how can I update a field when report is traversing dataset?

procedure TForm40.frxDBDataset1Next(Sender: TObject);
begin
frxReport1.Edit;
frxReport1.FieldByName('printdate').AsDateTime:= Date;
frxReport1.Post;
end;

Thanks

Sergio Melchiori


Comments

  • edited 1:24AM
    Since all the record of your dataset are printed at the same time (when the job is sent to the screen or the printer), I would update the PrintDate for all record at once after the report is done printing.

    If you really want to update the data directly in the dataset as the report is printing, you need to use the even of the dataset linked to your TfrxDBDataSet. Be careful, if your report is using the DoublePass... you might end up updating your data twice.

Leave a Comment