How to stop header beeing repeated on each page

Stimulsoft Reports.NET discussion
Post Reply
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

How to stop header beeing repeated on each page

Post by Tobias »

I have:

HeaderBand
DataBand-Master
DataBand-Detail
Footer-Band

The problem is, that the HeaderBand is repeated on each page. When setting the details to stick together, it happens that I have on page 1 the header but no date and on page 2 the header is repeated with the data following. In this case the header on page 1 is totally useless.

Any suggestions?

Tobias
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to stop header beeing repeated on each page

Post by HighAley »

Hello, Tobias.

Could you send us your report template with sample data for analysis?

Thank you.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Re: How to stop header beeing repeated on each page

Post by Tobias »

I'm afraid it's not that easy - this is really driving me nuts.

I've extracted the code to register the data and run the designer into a sample project using the exact samle report template and there it works fine, but not in my original application (same Reports.net dlls, same *.mrt) - totally weird!
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Re: How to stop header beeing repeated on each page

Post by Tobias »

I think found the reason: If for some row in the master data the details data is empty, this happens - I'm trying to prepare a sample.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Re: How to stop header beeing repeated on each page

Post by Tobias »

Ok, here's my code:

Code: Select all

public class Master
{
    public List<Detail> Details { get; set; }
}

public class Detail
{
}

Code: Select all

var stiReport = new StiReport();
stiReport.Load("Report.mrt");
stiReport.Dictionary.Clear();
stiReport.Dictionary.BusinessObjects.Clear();
stiReport.RegData("data", new List<Master>
{
    new Master
    {
        Details = new List<Detail>()
    },
    new Master
    {
        Details = new List<Detail>
        {
            new Detail(),
            new Detail(),
            new Detail(),
        }
    },
});

stiReport.Design(false);
Please note the the first Master-Record has an empty Details-List. This is what is causing the trouble. If I switch the two Master-records, it works fine.

I've attached the report template. As you will see - the "Foo"-Header is printed on the first AND the second page, but it should only be printed on the second page.
Attachments
Report.mrt
(8.91 KiB) Downloaded 352 times
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Re: How to stop header beeing repeated on each page

Post by Ivan »

Hello,

We made some improvements in that direction.
Please check the next prerelease build when it will be available and let us know about the result.

Thank you.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Re: How to stop header beeing repeated on each page

Post by Tobias »

Thanks! 2016.01.08 seems to fix this issue.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: How to stop header beeing repeated on each page

Post by Andrew »

Thank you, Tobias, for the reply.

Have a nice day!
Post Reply