Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Master/Detail - Help

edited September 2001 in General
I have a report with one subreport with the property drilldowncomponent
filled. I have one query to master and detail other query. Which the best
way to make this plugging being that when click in the DrillDownComponent
component it prints subreport and that query detail only brings the
registers filtered for the Query Master?

Thank you

Comments

  • edited September 2001
    The query fires because the Subreport.Visible = True. You'll need to custom
    code your own drill down subreport implementation, which wouldn't be a small
    task, and add on top of it to set the subreport to visible true only when
    the suberport is to be drilled down. The current implementation is that the
    subreport is visible, and so, the subreport will fire its query. You can't
    set a subreport to visible false and then to true in RB currently.

    You could try placing your data into in-memory tables to help performance.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    My problem is that I do not know where event I make to fill the parameter of
    the Query of the Subreport.

    Ex.

    Report Master

    Query : select * from Credores

    Code Name
    --------------------------
    1 S?rgio Luiz Theodorico Gomes
    |
    --> DrillDownComponent

    __________________________


    Report Detail

    Query: select * from informacoes where Code = :Code

    Informacoes
    ---------------------------------------------------------
    Desesperado, coisas assim.


    Which event I can fill the parameter of the Query Detail?


  • edited September 2001
    The event that fires fires would be the OnDrawCommandClick event of the
    component which causes the subreport to drilldown, however, since this event
    triggers the drilldown behavior, any OnDrawCommandClick event handler you
    have assigned, will not get called.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    You could try to use the BeforePrint event of the master report's detail
    band to setup the detail query, this is assuming that the drilldown
    subreport is located in the detail band. You can do something like this:

    qryDetail.Close;
    qryDetail.Params[0].AsFloat := qryMaster.FieldByName('CustNo').AsFloat;
    qryDetail.Open;


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.