Page 1 of 1

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

Posted: Thu Aug 23, 2012 11:37 am
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

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

Posted: Fri Aug 24, 2012 12:04 pm
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.

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

Posted: Fri Aug 24, 2012 12:42 pm
by vatsal24
It works!!!

Thanks a lot for your help.. :)

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

Posted: Fri Aug 24, 2012 1:41 pm
by HighAley
Hello.

We are always glad to help.

Thank you.