OnBeforePrint is called for all bands

GreatDayDanGreatDayDan Keller, Texas
edited 10:27AM in FastReport 4.0
Good Morning!

I am calling the OnBeforePrint method to load an image. This method is triggering for every band but I need to try to load the image only in a specific band.

How can I test for the (title) band so that I can bypass the other bands (and not try to load the image when they are printing?)

Thanks...Dan'l

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 10:27AM
    Dan

    if you are in the internal report script use the opb event of the pictureview object not the band's.

    if you are in delphi using the obp of the tfrxreport component which fires for every object in the report
    your event handler code becomes
    // use the name of the pictureviewobject in frs oi
    if sender.name = 'Picture1' then
    //cast the sender to its type and mod any props
    tfrxpictureview(sender).picture.loadfromfile('path&filename');

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.