Linking frxUserDataSets to Master Detail report

I'm trying to get a Master-Detail report to work using frxUserDataSets

I have a tiered TListView which I am trying to Print. In one frxUserDataSet I have the list of Groups from the TListView, this is linked to the MasterData in the report. Using the OnGetValue method of this DataSet gives me the correct number of Master Fields

In a second UserDataSet I want to show all the records under each group. I have tried to include Group in the Fields of the Person DataSet, but there is no way to link that to the Group Field in the Group DataSet. This results in each Group containing the full list of records in the Person DataSet

I have tried to filter the records in the OnGetValue method of the Person DataSet to return null if the groups do not match, but this just results in blank lines in the report where the groups are mismatched

Any Help?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:38AM
    "This results in each Group containing the full list of records in the Person DataSet"
    instead of trying to filter
    write code in the obp event of the band to control the visibility
    or post a demo project here and i'll take a look


  • edited 2:38AM
    gordk wrote: »
    "This results in each Group containing the full list of records in the Person DataSet"
    instead of trying to filter
    write code in the obp event of the band to control the visibility
    or post a demo project here and i'll take a look

    gordk

    Thanks for the offer.

    I've attached a trimmed down version of the reporting side of my application -
  • gordkgordk St.Catherines On. Canada.
    edited November 2013
    hi Dan sorry i din not get back to you sooner.
    set report engine options doublepass to true and
    add this code to your demo report

    var
    myvar:string;
    idx:integer;
    ar:tfrxarray;
    procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
    begin
    if engine.finalpass then
    begin
    masterdata1.visible := ar[<line#>] > 0;
    end;
    end;

    procedure MasterData1OnAfterPrint(Sender: TfrxComponent);
    begin
    if not engine.finalpass then ar[<line#>] := detaildata1.dataset.recordcount;
    end;

    begin
    ar := TfrxArray.Create;
    end.

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.