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:51PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.