Page 1 of 1

Print two different header and child data in two pages

Posted: Mon Jun 19, 2023 8:58 am
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


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

Posted: Mon Jun 19, 2023 3:58 pm
by Lech Kulikowski
Hello,

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

Thank you.

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

Posted: Mon Jun 19, 2023 4:45 pm
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

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

Posted: Tue Jun 20, 2023 6:08 am
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).

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

Posted: Wed Jun 21, 2023 1:14 am
by ziming99
Can you show me some example code

Thanks

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

Posted: Thu Jun 22, 2023 8:34 pm
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.