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:
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

  • edited 6:41PM
    Hello,

    Do you need data to be like in the attached picture ?

    Regards,

    egroups wrote: »
    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:
    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.
    rpt.png 29.9K
  • edited December 2018
    Hello,
    Yes this I need.
    boakoms wrote: »
    Hello,

    Do you need data to be like in the attached picture ?

    Regards,

    boakoms wrote: »
    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:
    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.
  • edited 6:41PM
    Hello,

    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.

    egroups wrote: »
    Hello,
    Yes this I need.
    egroups wrote: »
    Hello,

    Do you need data to be like in the attached picture ?

    Regards,

    egroups wrote: »
    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:
    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.
  • edited 6:41PM
    I modified generator adding Footer for TabulkaMasterData but result stil print DetailData only last row TabulkaMasterData:(
    And TabulkaMasterData is unsorted but filled corectly (ordered by dbtKod).
  • edited 6:41PM
    Hello,

    I use attached structure to get result like in the picture.

    Regards.
    egroups wrote: »
    I modified generator adding Footer for TabulkaMasterData but result stil print DetailData only last row TabulkaMasterData:(
    And TabulkaMasterData is unsorted but filled corectly (ordered by dbtKod).
  • edited December 2018
    Thanks for tip.
    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?
  • edited 6:41PM
    Hello,

    You need to set TabulkaPolozkaReportDS Master Source propert to TabulkaReportDS. like you did before :

    lDetailDataset.MasterSource:=lMasterDataSource;

    Regards.
    egroups wrote: »
    Thanks for tip.
    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?
  • edited 6:41PM
    Bingo,
    many thanks for your help.
    But I have last problem.
    Why last detail after last Master line is doubled?
    boakoms wrote: »
    Hello,

    You need to set TabulkaPolozkaReportDS Master Source propert to TabulkaReportDS. like you did before :

    lDetailDataset.MasterSource:=lMasterDataSource;

    Regards.
    boakoms wrote: »
    Thanks for tip.
    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?
  • edited 6:41PM
    Hello,

    could you attach fr3 file too.

    Regards.

    egroups wrote: »
    Bingo,
    many thanks for your help.
    But I have last problem.
    Why last detail after last Master line is doubled?
    egroups wrote: »
    Hello,

    You need to set TabulkaPolozkaReportDS Master Source propert to TabulkaReportDS. like you did before :

    lDetailDataset.MasterSource:=lMasterDataSource;

    Regards.
    egroups wrote: »
    Thanks for tip.
    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?
  • edited 6:41PM
    Sorry,this is fr3.
    boakoms wrote: »
    Hello,

    could you attach fr3 file too.

    Regards.
  • edited 6:41PM
    Hello,

    Make sure that subreport is in masterdata band.

    Regards.
    egroups wrote: »
    Sorry,this is fr3.
    egroups wrote: »
    Hello,

    could you attach fr3 file too.

    Regards.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.