master detail relationship using code with 2 fields
In your example,
var
lFieldLink: TppMasterFieldLink;
begin
{define the master/detail pipeline relationship}
plDetail.MasterDataPipeline := plMaster;
{create a new field link }
lFieldLink := TppMasterFieldLink.Create(nil);
lFieldLink.Parent := plDetail;
{assign the detail field name}
lFieldLink.DetailFieldName := 'CustNo';
{assign the master field name}
lFieldLink.MasterFieldName := 'CustNo';
end;
could the masterfieldname and detailFieldName has more than one field? that
is , DetailFieldName := 'field1;field2', MasterFieldName := 'field1;field2'?
also, I have a subreport which act as a detail dataset (e.g. dsDetail1), but
in the subreport detail band, I place another subreport as a detail for the
previous dataset(dsDetail2, detail of dsDetail1), is this possible?
Also, if the detailField has null value, what would happen?
I am using RB7.03
thx!!
var
lFieldLink: TppMasterFieldLink;
begin
{define the master/detail pipeline relationship}
plDetail.MasterDataPipeline := plMaster;
{create a new field link }
lFieldLink := TppMasterFieldLink.Create(nil);
lFieldLink.Parent := plDetail;
{assign the detail field name}
lFieldLink.DetailFieldName := 'CustNo';
{assign the master field name}
lFieldLink.MasterFieldName := 'CustNo';
end;
could the masterfieldname and detailFieldName has more than one field? that
is , DetailFieldName := 'field1;field2', MasterFieldName := 'field1;field2'?
also, I have a subreport which act as a detail dataset (e.g. dsDetail1), but
in the subreport detail band, I place another subreport as a detail for the
previous dataset(dsDetail2, detail of dsDetail1), is this possible?
Also, if the detailField has null value, what would happen?
I am using RB7.03
thx!!
This discussion has been closed.
Comments
You should be able to do so by simply creating another TppMasterFieldLink
object...
lFieldLink1 := TppMasterFieldLink.Create(nil);
lFieldLink2 := TppMasterFieldLink.Create(nil);
etc...
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I am using RB7.03
If the detail field is null the Master record will print only if the detail
pipeline's SkipWhenNoRecords property is set to False. Otherwise the master
and detail records do not display.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com