Picture Objects

edited August 2006 in FastReport 3.0
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;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:55PM
    first
    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.
    ;)
  • edited 2:55PM
    Cool I will give it go ;)
  • edited 2:55PM
    Thank you works great ... ;)

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.