Picture Objects
I need help clearing a picture object during runtime in the code editor
using a variable but cannot seem to get it to work.
Here is what i have tried.
<HeaderShow> Is a variable which i set in delphi with radiobuttons
frxReport1.Variables:=1
procedure PageHeader1OnAfterCalcHeight(Sender: TfrxComponent);
begin
case <HeaderShow> of
1:if <Page#> = 1 then
HeaderObj.picture.loadfromfile('C:\Diary\gfx\Default\DefualtLttheard.jpg');
2:if <Page#> > 1 then
HeaderObj.picture.loadfromfile('C:\Diary\gfx\Default\DefualtLttheard.jpg');
3:if <Page#> > 1 then
HeaderObj.picture:=nil;
end;
end;
Also I have no idea on which eventhandler to put it on.
But yet I have this code working on the <Page#>
procedure PageFooter1OnAfterCalcHeight(Sender: TfrxComponent);
begin
if <Surpress> = 1 then
if <Page#> = 1 then
PageNumberMemo.text := '';
if <Surpress> = 2 then
if <Page#> > 0 then
PageNumberMemo.text := '';
if <Surpress> = 3 then
if <TotalPages#> > 0 then
PageNumberMemo.text := <Page#>;
end;
using a variable but cannot seem to get it to work.
Here is what i have tried.
<HeaderShow> Is a variable which i set in delphi with radiobuttons
frxReport1.Variables:=1
procedure PageHeader1OnAfterCalcHeight(Sender: TfrxComponent);
begin
case <HeaderShow> of
1:if <Page#> = 1 then
HeaderObj.picture.loadfromfile('C:\Diary\gfx\Default\DefualtLttheard.jpg');
2:if <Page#> > 1 then
HeaderObj.picture.loadfromfile('C:\Diary\gfx\Default\DefualtLttheard.jpg');
3:if <Page#> > 1 then
HeaderObj.picture:=nil;
end;
end;
Also I have no idea on which eventhandler to put it on.
But yet I have this code working on the <Page#>
procedure PageFooter1OnAfterCalcHeight(Sender: TfrxComponent);
begin
if <Surpress> = 1 then
if <Page#> = 1 then
PageNumberMemo.text := '';
if <Surpress> = 2 then
if <Page#> > 0 then
PageNumberMemo.text := '';
if <Surpress> = 3 then
if <TotalPages#> > 0 then
PageNumberMemo.text := <Page#>;
end;
Comments
frxReport1.Variables:=1
creates a variable in the catagorized variable list if it is not named already
therefore to retreive it's value you must use the get method in report code.
ie in obp event of pageheaderband
var i: integer;
begin
i := get('Headershow');
case i of
1:
2:
10: ...
end;
end;
my own prefrence would be to load the picture once at reportstart
and then use the obp event of the picture object to control its visibility.