mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 15:56:00 +02:00
LazReport: Find dataset when TFrReport has no owner.
git-svn-id: trunk@63869 -
This commit is contained in:
parent
796f05d611
commit
a1dc800a66
@ -83,7 +83,7 @@ function UTF8CountWords(const str:string; out WordCount,SpcCount,SpcSize:Integer
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses LR_Class, LR_Const, LR_Pars, LazUtilsStrConsts, LR_DSet, LR_DBComponent;
|
uses LR_Class, LR_Const, LR_Pars, LazUtilsStrConsts, LR_DSet, LR_DBSet, LR_DBComponent;
|
||||||
|
|
||||||
var
|
var
|
||||||
PreviousFormatSettings: TFormatSettings;
|
PreviousFormatSettings: TFormatSettings;
|
||||||
@ -346,6 +346,7 @@ var
|
|||||||
Component: TComponent;
|
Component: TComponent;
|
||||||
F:TfrObject;
|
F:TfrObject;
|
||||||
S1, S2:string;
|
S1, S2:string;
|
||||||
|
DSet: TDataSet;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if ComplexName = '' then exit;
|
if ComplexName = '' then exit;
|
||||||
@ -368,6 +369,15 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
F:=CurReport.FindObject(ComplexName);
|
F:=CurReport.FindObject(ComplexName);
|
||||||
|
if (F=nil) and (CurReport.Dataset is TfrDBDataSet) then
|
||||||
|
begin
|
||||||
|
DSet := TfrDBDataSet(CurReport.Dataset).DataSet;
|
||||||
|
if (DSet=nil) and (TfrDBDataSet(CurReport.Dataset).DataSource<>nil) then
|
||||||
|
DSet := TfrDBDataSet(CurReport.Dataset).DataSource.DataSet;
|
||||||
|
if (DSet<>nil) and SameText(ComplexName, DSet.Name) then
|
||||||
|
Component := DSet;
|
||||||
|
end
|
||||||
|
else
|
||||||
if F is TLRDataSetControl then
|
if F is TLRDataSetControl then
|
||||||
Component:=TLRDataSetControl(F).DataSet;
|
Component:=TLRDataSetControl(F).DataSet;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user