TfrxUserDataSet

Hi all

I'm trying to build a report in code. I'd like to have a TfrxMasterData and an associated TfrxUserDataSet. So far I can 'inject' the items into the report and the appear on the correct pages. However I'm struggling to get the user data to get data from the

OnGetValue, OnFirst, OnNext, OnPrior

as the events aren't being called. What newbie mistake am I making...? [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Code snippet: var MasterData : TfrxMasterData; ds : TfrxUserDataSet; DataPage : TfrxDataPage; begin if FReport.Pages[0] is TfrxDataPage then DataPage := FReport.Pages[0] as TfrxDataPage; MasterData := TfrxMasterData.Create(APage); MasterData.CreateUniqueName; MasterData.Left := DesignToPageX(AX, AParentPanel.Width, APage.Width); MasterData.Top := DesignToPageY(AY, AParentPanel.Height, APage.Height); MasterData.Width := 500; MasterData.Height := 50; MasterData.Overflow := true; ds := TfrxUserDataSet.Create(DataPage); ds.CreateUniqueName; ds.RangeEnd := reCount; ds.RangeEndCount := 10; ds.Fields.Add('Field1'); ds.OnGetValue := UserDataSetGetValue; ds.OnFirst := UserDataSetFirst; ds.OnNext := UserDataSetNext; ds.OnPrior := UserDataSetPrior; MasterData.DataSet := ds; FReport.DataSets.Add(ds)[/img]

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 7:19AM
    The tfrxuserdataset and its events belong on the delphi form not in the report the report.
    Look at the masterdetail uds demo in your fastreport 4/demos folder.
  • edited 7:19AM

    Ok, thanks. Confusion for me is that I'm creating the MasterData and UserDataSet in code, no forms. Our customers require very flexable reporting so it's done on the fly as the create them.

    As I've got the MasterData/MemoView working fine now I'll just go with it and not use the UserDataSet...

    Friday brain fry. Will look at the UserDataSet on Monday again.

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.