Enumerating Datasets when using frames
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:
Could you please fix it in your next release?
Best regards,
Holger Heidenbluth
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:
? 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
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.