Access Objects..
Hi,
Im a newbie.. Ive created a form, that I want to populate with data. I've added some variables, and I can populate, then print the form. Im not using any bands, but just a simple form..
Anyway, I have some check boxes i the form.. From code, I want to turn the check boxes on or off. I for the life of me cant figure out how to access those properties from code. Can someone help??
Gchamm
Im a newbie.. Ive created a form, that I want to populate with data. I've added some variables, and I can populate, then print the form. Im not using any bands, but just a simple form..
Anyway, I have some check boxes i the form.. From code, I want to turn the check boxes on or off. I for the life of me cant figure out how to access those properties from code. Can someone help??
Gchamm
Comments
ie
procedure CheckBox1OnBeforePrint(Sender: TfrxComponent);
begin
checkbox1.checked := <My Variable 1> = 20;
end;
this example assumed "my variable 1" was added to the variables list and given a value either when created or using the set method somewhere in report code.
or
you can also use an onbefore print event of the report component to retrieve a value from delphi
ie
if sender.name = 'CheckBox1' then
tfrCheckboxview(sender).checked := some boolean value.
you can iterate through all the objects and set their values
either from just after loading the report in delphi and using the findobject method
or internally
in obp of page
var
i: Integer;
c: TObject;
begin
for i := 0 to Sender.Objects.Count - 1 do
begin
c := Sender.Objects
if c is TfrxCheckboxView then
TfrxCheckboxView©.Visible := False;
end;
end;
should have read
TfrxCheckboxView( C ).Visible := False;