Problem with GroupHeaderBand

Stimulsoft Reports.NET discussion
shmuly
Posts: 58
Joined: Wed Jul 05, 2006 2:19 pm

Problem with GroupHeaderBand

Post by shmuly »

I am trying to create a report that contains 2 levels of grouping with each of the grouping and the detail starting on the same line.

Example:

Account 1-------------------Campaign ABC--------------------Invoice #2
--------------------------------------------------------------------Invoice #3


Right now, when I use 2 GroupHeaderBands and a data band, I get:

Account 1
------------------------------Campaign ABC
--------------------------------------------------------------------Invoice #2
--------------------------------------------------------------------Invoice #3

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with GroupHeaderBand

Post by Vital »

Hello,

Set height of second GroupHeaderBand to zero. After then place on DataBand text box component which will be output "Campaign ABC". For this text component set property ProcessingDuplicates to Merge.

Thank you.
shmuly
Posts: 58
Joined: Wed Jul 05, 2006 2:19 pm

Problem with GroupHeaderBand

Post by shmuly »

We tried this, but the problem is when we have repeated data (in this case accounts and campaign). First, we do not want to do a merge, I would want the account and campaign to just appear on the first line (I tried using the hide for processingDuplicates).

Account 1-------------------Campaign ABC--------------------Invoice #2
--------------------------------------------------------------------Invoice #3
Account 2-------------------Campaign ABC-------------------Invoice #4
--------------------------------------------------------------------Invoice #5

the issue with this is that the words in bold will not show up because it is a repeat of the previous campaign.

We need a way to put two data bands vertically in the same position. Please advise.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with GroupHeaderBand

Post by Vital »

Try to place GroupFooterBand with very small height (but not equal to zero).

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with GroupHeaderBand

Post by Vital »

Try to place GroupFooterBand with very small height (but not equal to zero).

Other variant: Place on DataBand textbox with "Campaign ABC". After then set condition to this textbox - "Line != 0". Checkbox "Enabled" set to false.

Thank you.
shmuly
Posts: 58
Joined: Wed Jul 05, 2006 2:19 pm

Problem with GroupHeaderBand

Post by shmuly »

I don't understand the first method.

The second method won't work for us. See the example below:

Account 1-------------------Campaign ABC--------------------Invoice #2
--------------------------------------------------------------------Invoice #3
------------------------------Campaign DEF--------------------Invoice #4
--------------------------------------------------------------------Invoice #5
Account 2-------------------Campaign ABC-------------------Invoice #4
--------------------------------------------------------------------Invoice #5

In this case, Campaign DEF would not show.

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with GroupHeaderBand

Post by Vital »

Hello,
I don't understand the first method.
Place GroupFooterBand with height around 1-2 h-inches.
The second method won't work for us. See the example below:

Account 1-------------------Campaign ABC--------------------Invoice #2
--------------------------------------------------------------------Invoice #3
------------------------------Campaign DEF--------------------Invoice #4
--------------------------------------------------------------------Invoice #5
Account 2-------------------Campaign ABC-------------------Invoice #4
--------------------------------------------------------------------Invoice #5

In this case, Campaign DEF would not show.
Ok. In this case you can use following way:

1. Create variable "PrevValue" in report dictionary with string type.
2. After then in BeforePrintEvent of campaign text box palce following code:

Code: Select all

textBox.Enabled = PrevValue != DataSource.CompaignName;
PrevValue == DataSource.CompaignName;
3. In Event EndRenderEvent of GroupHeaderBand place following code:

Code: Select all

PrevValue = null;
Thank you.
shmuly
Posts: 58
Joined: Wed Jul 05, 2006 2:19 pm

Problem with GroupHeaderBand

Post by shmuly »

Is there a simpler way of doing this? For now if this would work for more than one grouping then this will work, but, it is not a permanent solution.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Problem with GroupHeaderBand

Post by Vital »

Hello,

At this moment - no.

Thank you.
sector7g
Posts: 26
Joined: Tue Apr 29, 2008 9:32 am
Location: Germany

Problem with GroupHeaderBand

Post by sector7g »

An idea:
Try the first solution, vital has given, but add the 2 textboxes that shows "Account x" and "Campaign ABC" to one textbox.
In that textbox write {[XY].Account.ToString()+"----"+[XY].Campaign.ToString()}.

Maybe that works.

Ralf
Post Reply