Epo 1 Posted May 7, 2021 (edited) Hi, How can I do to bind -e.g. the color of- a shape (set on each line of a DataBand) with a field of the current line of dataset. I have tried to use the event "OnBeforePrint" (of the DataBand and of the object itself) but it does not work. Maybe it is the field access that is not correct. Thank for help, Eddy procedure DataBandOnBeforePrint(Sender: TfrxComponent); begin if <Sample.CFRStatus> = '0' then shCFR.Visible := False else begin shCFR.Visible := True; if <Sample.CFRStatus> = '2' then shCFR.Color := clRed else if <Sample.CFRStatus> = '1' then shCFR.Color := clGreen; end; end; procedure shCFROnBeforePrint(Sender: TfrxComponent); begin if <Sample.CFRStatus> = '0' then shCFR.Visible := False else begin shCFR.Visible := True; if <Sample.CFRStatus> = '2' then shCFR.Color := clRed else if <Sample.CFRStatus> = '1' then shCFR.Color := clGreen; end; end; Edited May 7, 2021 by Epo Share this post Link to post
Guest Posted May 7, 2021 (edited) OnBeforePrint is the correct event. In my "FR scripts" the fields are accessed like so: <Table."FieldName"> Note the "'s. You can also use "View | Toolbars | Data Tree" and double click a field. It will be pasted into you script with the correct format for your setup. HTH, /Dany Edited May 7, 2021 by Guest Share this post Link to post
Epo 1 Posted May 7, 2021 Effectively, the ' " ' was missing. And it does the trick. Thank Dany, Share this post Link to post