MasterData+DetailData print DetailData only at last MasterData
I create complete report at runtime via ManualBuild.
I have 2 memory datasets with Master and Detail (XML attached).
Each item in MasterData can have any rows DetailData (simulated in this example test if MasterData contains any string).
In code I setup this:
Datasets filled correctly,but DetailData printed only after MasterData band,Why?
Whats is bad?
I attached
MasterCDS.xml=data for master ClientDataset
DetailCDS.xml=data for detail ClientDataset
AfterGenerate.fr3=generated report
Doklad.pdf=Result report in PDF.
I have 2 memory datasets with Master and Detail (XML attached).
Each item in MasterData can have any rows DetailData (simulated in this example test if MasterData contains any string).
In code I setup this:
lMasterDataSource:=IntForm.FindComponent('TabulkaDatasource') as TDatasource;
lDetailDataset.MasterSource:=lMasterDataSource;
lDetailDataset.MasterFields:='dbtKod';
lDetailDataset.IndexFieldNames:='Kod';
Datasets filled correctly,but DetailData printed only after MasterData band,Why?
Whats is bad?
I attached
MasterCDS.xml=data for master ClientDataset
DetailCDS.xml=data for detail ClientDataset
AfterGenerate.fr3=generated report
Doklad.pdf=Result report in PDF.
Comments
Do you need data to be like in the attached picture ?
Regards,
Yes this I need.
Then you need to place Footer after Master Data and select Print Footer After Each Row (or something like that ) in Master Data Options.
Regards.
And TabulkaMasterData is unsorted but filled corectly (ordered by dbtKod).
I use attached structure to get result like in the picture.
Regards.
I removed footer for Master and added Subreport aka your example,but stil bad output.
I simplified report,removed many items etc.
Output contains DetailData,but every Detail on Every Master band:(
I attached outputs.
Any another idea?
You need to set TabulkaPolozkaReportDS Master Source propert to TabulkaReportDS. like you did before :
lDetailDataset.MasterSource:=lMasterDataSource;
Regards.
many thanks for your help.
But I have last problem.
Why last detail after last Master line is doubled?
could you attach fr3 file too.
Regards.
Make sure that subreport is in masterdata band.
Regards.