How to add group header band in existing report from code?

Stimulsoft Reports.WEB discussion
Post Reply
vatsal24
Posts: 10
Joined: Sat Mar 31, 2012 7:32 am
Location: India

How to add group header band in existing report from code?

Post by vatsal24 »

Hi,

I want to add GroupHeaderBand in existing report beneath "HeaderTransactions" and above "DataTransactions", from code behind .

I am using below code to add new groupheaderband to existing report but it adds groupheaderband at last so report do not populate correct data.

Code: Select all

StiGroupHeaderBand h = = new StiGroupHeaderBand();
h.Name = "GroupHeaderBand1";
h.KeepGroupTogether = true;
page.Components.Add(h);
Please help...

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

Re: How to add group header band in existing report from cod

Post by HighAley »

Hello.
vatsal24 wrote:I want to add GroupHeaderBand in existing report beneath "HeaderTransactions" and above "DataTransactions", from code behind .

I am using below code to add new groupheaderband to existing report but it adds groupheaderband at last so report do not populate correct data.
Please, try to use next code:

Code: Select all

StiGroupHeaderBand h = new StiGroupHeaderBand();
h.Name = "GroupHeaderBand1";
h.KeepGroupTogether = true;
rep.Pages[0].Components.Insert(rep.Pages[0].Components.IndexOf(rep.GetComponentByName("DataTransactions")), h);
Thank you.
vatsal24
Posts: 10
Joined: Sat Mar 31, 2012 7:32 am
Location: India

Re: How to add group header band in existing report from cod

Post by vatsal24 »

It works!!!

Thanks a lot for your help.. :)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to add group header band in existing report from cod

Post by HighAley »

Hello.

We are always glad to help.

Thank you.
Post Reply