Subreport relation to masterdata

edited 5:22PM in FastReport 4.0
I have a scenario where a band (masterdata) contains a subband (in addition to several regular detail data bands).

I have thus created a subreport within the masterdata band, which itself contains another masterdata band (trying with a detailband resulted in an error; i.e. that there was no masterdata band on the page which the subreport refers to), but this is not in my best interest, because the data table the subreport's own masterdata band refers to is indexed by the key of the master-masterdata band.

But because there is no relation between these two bands (the master-masterdata and the subreport-masterdata), each time the subreport appears, it displays the entire table, because it is not indexed/detailed by the key.

How do I do that?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:22PM
    is there a field that is common between the two
  • edited 5:22PM
    gordk wrote: »
    is there a field that is common between the two

    Yes, they both have a field called 'siSite'.
  • gordkgordk St.Catherines On. Canada.
    edited 5:22PM
    try setting the visible property of the subreps masterdata band in its obp event
  • edited 5:22PM
    gordk wrote: »
    try setting the visible property of the subreps masterdata band in its obp event

    obp event? So in the masterband I set the visibility of the subrep's masterdata? But how do I make sure that it is only for the same field?
  • gordkgordk St.Catherines On. Canada.
    edited 5:22PM
    obp event is the onbeforeprint event.
    write code in the obpevent of the subreps masterdataband
    if (<dataset1name."siSite"> = <dataset2name."siSite">) then subrepmasterdatabandname = true esle subrepmasterdatabandname = false

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.