frxUserDataSet - is this just a virtual data set?

hsmhsm
edited 10:19AM in FastReport 4.0
Am I correct in my understanding that the frxUserDataSet component cannot actually contain data itself but that it merely handles the navigation through another set of data held elsewhere (eg an array or list of some sort) and that is does this by providing the programmer with a virtual 'RecNo' that is incremented each time a record is displayed in the report.

So we always use the procedure Report.GetValue to obtain the actual data at position RecNo in the actual data?

(like in the demo PrintStringList)

procedure TForm1.frxReport1GetValue(const VarName: String; var Value: Variant);
begin
  if CompareText(VarName, 'element') = 0 then
    Value := sl[StringDS.RecNo];    <-------- here
end;

Comments

  • gpigpi
    edited 10:19AM
    You may use dataset's OnFirst, OnNext, OnPrior, OnGetValue, OnCheckEOF events and get dataset like TfrxDBDataset
  • hsmhsm
    edited 10:19AM
    gpi wrote: »
    You may use dataset's OnFirst, OnNext, OnPrior, OnGetValue, OnCheckEOF events and get dataset like TfrxDBDataset
    Ok thank you. I did spend some time looking at the demos and I couldn't see where the UserDataSet got loaded or how RecNo ever got updated.
    Now I realise it never does get loaded but sort of acts as a wrapper around any other data in order to present the data to frxReport using the same uniform interface that TfrxDBDataset presents.

    A very clever idea now that I understand how it works!

    Regards

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.