DBX master detail

dbxquery1 is an select * from data left join etc...
dbxquery2 is an select * from subdata left join etc... where id = :id

I set up the id param as data.id and the mastersource to dbxquery1

If I preview I get the error, cannot do this on a closed dataset, or if I change the create order a GPF. Fields are updated (ie no sql error). The way I solved it for now: in the beforeprintband of dbxquery1 I close dbxquery2 and open it again. This results in a correct report with again the notice that there are no sql errors otherwise this would not work.

Am i doing something wrong?

Comments

  • edited 11:06PM
    Ah, just had a clear moment: this goes only wrong if you have a 2 pass report, in the second pass it errors!
  • edited 11:06PM
    Would be good if someone could confirm this. Only designed master detail in 2 pass goes wrong with an 'cannot do this on a close dataset'. This is in the method first of the tfrxdbdataset where initialized = True but in the second pass the table is closed and therefore not is opened.

    my solution was to create a manual masterdetail en take care myself of the regfresh on 'master' skip

Leave a Comment