Enumerating Datasets when using frames

edited October 2003 in FastReport 2.xx VCL
Hello,

I want to report a bug. My report is based on a dataset that is part of a frame. The frame itself resides on a tabsheet of a TPageControl. Unfortunately, I cannot see the dataset and its field list in the report designer. ;)

Lets have a look at the EnumComponents function within the FR_utils.frGetComponents procedure. I made two changes, and everything workes fine now:
wrote:
?  procedure EnumComponents(f: TComponent);
?  var
?  ?  i: Integer;
?  ?  c: TComponent;
?  begin
{$IFDEF Delphi5}
{?  ?  if f is TForm then
?  ?  ?  for i := 0 to TForm(f).ControlCount - 1 do
?  ?  ?  begin
?  ?  ?  ?  c := TForm(f).Controls;
?  ?  ?  ?  if c is TFrame then
?  ?  ?  ?  ?  EnumComponents?©;
?  ?  ?  end;}
?  ?  // iterate components and find also frames on tabsheets and other subordinate controls within the form
?  ?  if f is TForm then
?  ?  ?  for i := 0 to TForm(f).ComponentCount - 1 do
?  ?  ?  begin
?  ?  ?  ?  c := TForm(f).Components;
?  ?  ?  ?  if c is TFrame then
?  ?  ?  ?  ?  EnumComponents?©;
?  ?  ?  end;
{$ENDIF}
?  ?  for i := 0 to f.ComponentCount - 1 do
?  ?  begin
?  ?  ?  c := f.Components;
?  ?  ?  if (c <> Skip) and (c is ClassRef) then
?  ?  ?  ?  if f = Owner then
?  ?  ?  ?  ?  List.Add(c.Name)
?  ?  ?  ?  else if ((f is TForm) or (f is TDataModule)) then
?  ?  ?  ?  ?  List.Add(f.Name + '.' + c.Name)
?  ?  ?  ?  else begin
// Owner of the frame, i.e. the Form, instead of parent, i.e. the tab sheet
          //?  List.Add(TControl(f).Parent.Name + '.' + f.Name + '.' + c.Name)
?  ?  ?  ?  ?  List.Add(TControl(f).Owner.Name + '.' + f.Name + '.' + c.Name);
?  ?  ?  ?  end
?  ?  end;
?  end;

;)

Could you please fix it in your next release?

Best regards,

Holger Heidenbluth

Comments

  • edited 3:29AM
    Good Day ;)

    Double thumbs up to this one, I posted a issue I was having with the UserDataset, I eventually decided to create a custom dataset to referance an Object and recurse through it as if it where a dataset.

    This bug fix fixes an error where the dataset could be seen but not the fields within that custom dataset.

    Referancing the field name directly by [myDataset."MyField"] caused Fast Report to Raise an exception with undefiened Symbol error.

    Thank you for this Posting this issue as it has saved me many hours of frustration.




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.