Print two different header and child data in two pages

Stimulsoft Reports.NET discussion
Post Reply
ziming99
Posts: 3
Joined: Mon Jun 19, 2023 8:44 am

Print two different header and child data in two pages

Post by ziming99 »

I want to print two pages with different Header and Child dataset but same format (Ex: first page should show Doc :TR0001, second page should show Doc:TR0002)

How can I do that?

Code: Select all


        Dim report = StiReport.CreateNewReport()
        Dim path = Server.MapPath("reports/interbranch.mrt")

        report.Load(path)

        'Dim dtsettest = GetDataSetData()
        'Dim dtdatasource = GetDataSetDataSourceData()

        report.dictionary.databases.clear()
        report.regData(GetDataSetData()) 'FIRST HEADER DATASET
        report.regData(GetDataSetDataSourceData()) ' FIRST CHILD DATASET

        report.regData(GetDataSetData()) ' SECOND HEADER DATASET
        report.regData(GetDataSetDataSourceData()) 'SECOND CHILD DATASET


        report.dictionary.synchronize()

        e.Report = report

Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Print two different header and child data in two pages

Post by Lech Kulikowski »

Hello,

You can register two different datasets and use two Pages in your report.

Thank you.
ziming99
Posts: 3
Joined: Mon Jun 19, 2023 8:44 am

Re: Print two different header and child data in two pages

Post by ziming99 »

Hi, Thank you for your reply

The number of pages might be vary. If user has selected 5 documents to print(5 datasets), i need to prepare for 5 pages? Or is there another way to do it without fixing the number of pages
ulli82
Posts: 47
Joined: Tue Jul 06, 2021 6:46 am

Re: Print two different header and child data in two pages

Post by ulli82 »

You can use page property 'NumberOfCopies' and set the datasources using code (with property 'PageCopyNumber' you know which page copy is actually printing).
ziming99
Posts: 3
Joined: Mon Jun 19, 2023 8:44 am

Re: Print two different header and child data in two pages

Post by ziming99 »

Can you show me some example code

Thanks
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Print two different header and child data in two pages

Post by Lech Kulikowski »

Hello,

Do you have a different structure of data for each document/page? Or the structure is the same, only data is different.
If yes, use one dataset and the NewPageBefore for each row.

Thank you.
Post Reply