Master-Detail with TClientDataSet

edited July 2011 in FastReport 4.0
I want to create a master-detail report with 2 ClientDataSet, which are connected to a DataSetProvider.

The detail band always shows the same record for all master records. Allthough, it is correctly displayed in the DBGrid.

What I am doing wrong?

Some background info:
The detail ClientDataSet has no master relation defined (all data are loaded at once), this is necessary for the DevExpress QuantumGrid, which is doing a master detail relationship on its own style. Just before I print the report, I clone my detail CDS and set the proper master fields, in order the Report can apply the detail filter (as descript in the UserManual.pdf).

Can anybody help me. I don't know what I am doing wrong?
  cdsDetail := TClientDataSet.Create(self);
  cdsDetail.CloneCursor(cdsOpZahlung, false);
  cdsDetail.IndexFieldNames := cdsOpZahlungOPID.FieldName;
  cdsDetail.MasterSource := dscrAnlage;
  cdsDetail.MasterFields := cdsAnlageEABUCHID.FieldName;

  rdsOpDetail.DataSet := cdsDetail;//frxDBDataSet

Comments

  • edited 9:04AM
    Found the issue. It seems for the master-detail relation the master must not call TDataSet.DisableControls.

    That makes the report genaration slow and looks strange, since you see how the Grid is scrolling down [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Is there another solution?[/img]

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.