creating subreport in code
I am creating a subreport in code, using the example from the wiki.
However, I need srGenSumm to contain in its detail band srGenSummDtls.
My difficulty is in finding the proper assignment for:
srGenSumm := TppSubReport.Create(Self);
srGenSumm.Band := repMain.DetailBand;
srGenSumm.CreateReport(repMain);
repGenSumm := TppChildReport(srGenSumm.Report);
repGenSumm.DataPipeline := plGenSumm;
srGenSummDtls := TppSubReport.Create(Self);
srGenSummDtls.Band := ???
srGenSummDtls.CreateReport(repMain);
repGenSummDtls := TppChildReport(srGenSummDtls.Report);
srGenSummDtls.DataPipeline := plGenSummDtls;
Thanks,
Bill Meyer
However, I need srGenSumm to contain in its detail band srGenSummDtls.
My difficulty is in finding the proper assignment for:
srGenSumm := TppSubReport.Create(Self);
srGenSumm.Band := repMain.DetailBand;
srGenSumm.CreateReport(repMain);
repGenSumm := TppChildReport(srGenSumm.Report);
repGenSumm.DataPipeline := plGenSumm;
srGenSummDtls := TppSubReport.Create(Self);
srGenSummDtls.Band := ???
srGenSummDtls.CreateReport(repMain);
repGenSummDtls := TppChildReport(srGenSummDtls.Report);
srGenSummDtls.DataPipeline := plGenSummDtls;
Thanks,
Bill Meyer
This discussion has been closed.
Comments
1. You need to call TppChildReport.CreateDefaultBands in order to properly
create and access its detail band. This is in the rbWiki article code.
2. Once you've created the default bands, you can use the
TppChildReport.DetailBand property as the child component's Band property.
This is also in the rbWiki article code (only with a DBText rather than a
Subreport).
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Layouts/Create_SubReport_in_Code
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks, I discovered a bit later I had overlooked it.
Bill