Locating and changing shapes on a preview from script

edited 6:24PM in FastReport 4.0
Hi. I have a question on using script with a report preview.
I see that I can toggle the color of a shape using:
procedure shpSelOnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
Shape : TfrxShapeView;
begin
Shape := TfrxShapeView(Sender);
If Shape.Color = clNone then
Shape.Color := clBlack
else
Shape.Color := clNone;
Modified := True;
end;

I would now like to toggle an entire row of shapes using a click on another shape. I extended the code above to become:
procedure Shape1OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
Shape : TfrxShapeView;
I : integer;
S : string;
begin
For I := 0 to 17 do
begin
S := 'shpR0C' + IntToStr(I);
Shape := TfrxShapeView(Page1.FindObject( S ));
If Shape <> nil then
begin
If Shape.Color = clNone then
Shape.Color := clBlack
else
Shape.Color := clNone;
end;
end;
end;
But I dont see any change. I seem to be locating the target shape (it shows up as a number in the debugger) but I dont know how to refresh it.
Where can I find documentation that gives me the methods that I can call on shapes etc in script code?

Thanks

Comments

  • edited 6:24PM
    Hello,

    same Problem here.
    for i = 0 to MainPage.AllObjects.Count - 1
    if MainPage.AllObjects.Items[i].ClassName = "TfrxShapeView" then                                                                      
    TfrxShapeView(MainPage.AllObjects.Items[i]).visible = false                                    
    end if
    

    Doesnt Display in Preview. Any Solutions?

    Thx in Advance

Leave a Comment