DBXQuery

I am converting an fr2 report to fr3 in a delphi7 environment. The report has 2 dbxquerys that are related as master/detail. In fr2, I was able to coordinate using paramters. In fr3, it appears that the detail table query occurs once at the beginning, rather then once for each master record selected. The detail band appears below the master band and I've tried both with and without the master property set in the detail query. The user manual only talks about how to do master/detiail via delphi tables/datasets/datasources. How do you do master/detail using dbxquery?

Comments

  • edited 2:35AM
    I did some followup checking and I have the same problem with bde queries too. Is it still possible to do master/detail reports within FASTREPORT as was in version 2 where the queries are defined in the form rather then using datasets defined in delphi?
  • edited 2:35AM
    ;) I seem to be talking to myself here- No one has offered any help..., but I've figured out the following workaround, I've placed the following code in the Masteronbeforeprint procedure. Strangly it mostly works without the active/inactive but sometimes doesn't. From what I can tell, parameters on the detail query are just being set at the beginning in fr3 and are not being reset for each master (Bug??). This stuff all worked ok in fr2.

    detail.active := False;
    detail.params[0].value :=vartostr(<master."WORKSPACEID">);
    detail.params[1].value :=vartostr(<master."BASEID">);
    detail.active := True;
  • edited 2:35AM
    Just set the DetailQuery.Master property to MasterQuery. DetailQuery Params should have names same as MasterQuery master fields.
  • edited 2:35AM
    ;) Thank you so much for your help. It worked like a charm. I've been stuck trying to get this to function for weeks.
  • edited 2:35AM
    ;) I spoke too soon - It works great for master/detail, but when I do master/detail/subdetail I get an "operation can not be performed on a closed dataset" when it goes to the second master record.

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.