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

Comments

  • edited 6:09AM
    What I mean by a form , is a business form, that will be populated with real time data.. then printed.
  • gordkgordk St.Catherines On. Canada.
    edited 6:09AM
    use the obp event of the checkbox
    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.
    ;)


  • edited 6:09AM
    Thanks, I think that helps.. But Ive got about 40 check boxes that I'd like to do all at once.. I.E. Reset them all to unchecked.. I guess Id have to build a large "if then" structure to do that huh?

  • gordkgordk St.Catherines On. Canada.
    edited 6:09AM
    depending on where you do it from
    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;

    ;)
  • gordkgordk St.Catherines On. Canada.
    edited 6:09AM
    TfrxCheckboxView?©.Visible := False;
    should have read
    TfrxCheckboxView( C ).Visible := False;
    ;)

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.