Turn multiple of bands on and off?

edited April 2014 in FastReport 4.0
Hello again,

Is there an easy way to group sets of bands to turn them on and off easily? This would be like for controlling sections of a report. Some sections would contain just a master data band, but some sections could contain a header, master, details and footer bands in any combinations. I thought about using pages for this, but there are already quite a few pages in the report and I did not know if there is a better mechanism for achieving this.
(Using Delphi XE3, Fast Reports Professional V4.13.1)

Thank you.
Jerry

Comments

  • edited 6:52PM
    You can turn off a band like this

    ((TfrxBand*)FastReport3->FindObject("DetailData1"))->Visible = false;

    You can do this from the GETVALUE code from an earlier band's data.
  • gordkgordk St.Catherines On. Canada.
    edited 6:52PM
    Jerry the easiest way is to create a dialog page with check boxes
    set variable to true or false depending upon the checkbox state
    in the bands that you want to hide set the visible proberty in the obp event
    bandname.visible := varname
  • edited 6:52PM
    Hello,

    I appreciate the responses.
    I realize the visible property controls whether the band shows up or not in the report. I was wondering if there was a recommended way of controlling a group of related bands that should be shown or not shown together. I know putting the band on a single page and enabling or disabling that page is one way of doing this. Another way would be finding all the related bands individually and setting the visible property for each band. Both those methods will work, but I was asking to see if there was a more accepted way of handling multiple bands as a set. (I guess sub-reports would be another way, but I have not done much in that area yet.)

    Thank you.
    (P.S. An answer to the question about how to force a band to print on the bottom of the first page would really help, since I do not know how to approach that one.)
  • gordkgordk St.Catherines On. Canada.
    edited 6:52PM
    In the obp event of the band you want to fore down
    write code to check the engine .freespace and set the engine s cury position.
    here is a sample of driving a summary band down to the page footer.
    begin
    if engine.freespace > reportsummary1.height then
    begin
    Engine.CurY := Engine.PageHeight -reportsummary1.height -pagefooter1.Height - 1;

    end;
    end;

    sub your footerband name for reportsummary band
  • edited 6:52PM
    Gordk,

    Thank you for the response.
    My problem is that I have many bands on the page and I do not know how to set it up so that when the end of the first page comes I can print a specific band on the bottom of the first page.

    Header
    Band1
    Band2
    Band3
    Band4
    Band5
    Band6
    Band7
    Etc.

    The bands vary in size from report to report, so the page break may come between band2 and band3, or between band5 and band6, or band4 might be slit across the page break, or any other combination. But there is another band that I need to be printed at the bottom of the first page no matter what the other bands are doing (or which page ends up being the first page printed).
    Any ideas on how to accomplish this?

    Thank you.
    Jerry

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.