This is a migrated thread and some comments may be shown as answers.

Conditional group headings

4 Answers 185 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 01 Mar 2013, 07:58 PM
I have a report where I have a hierarchy of data related to work schedules.. Some of the time that is tracked has an additional grouping I need to total on, others don't.. see below:

DIVISION OF LABOR
   Optional Category
     Employee 1 [time worked]
     Employee 2 [time worked]
  Optional category totals
DIVISION OF LABOR TOTALS

Some divisions of labor will have the optional category that requires totals, some will not.
ADMIN STAFF
     Employee 1 [hours worked]
     Employee 2 [hours worked]
     Employee 3 [hours worked]
ADMIN STAFF TOTALS
 
SUPERVISION
   Supervisors
     Employee 1 [hours worked]
     Employee 2 [hours worked]
   Supervisors Totals
 
   Asst. Supervisors
     Employee 1 [hours worked]
     Employee 2 [hours worked]
   Asst. Supervisors Totals
 
SUPERVISION TOTALS
 
LABOR & LOGISTICS
   Labor Foreman
     Employee 1 [hours worked]
     Employee 2 [hours worked]
   Labor Foreman Totals
 
   Laborer / Logistics
     Employee 1 [hours worked]
     Employee 2 [hours worked]
   Laborer / Logistics Totals
 
   Laborer
     Employee 1 [hours worked]
     Employee 2 [hours worked]
   Laborer Totals
 
LABOR & LOGISTICS TOTALS

In the above, Admin Staff has no sub-category or totals. Labor & Logistics does. 

So.. I need a grouping with totals for the "Optional" category but do not need that optional category for Admin staff and other divisions of labor that do not need sub-grouping categories. I have the data being captured already, I just need to know how make the report do this.

Thanks.

4 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 06 Mar 2013, 02:52 PM
Hi Matthew,

We will need some more data about your setup since this is important to the layout. What data source are you using and also are the optional groups missing or are they just omitted (for example admin staff has subgroup admin staff which has all the employees)? Please also note that any other relevant information regarding your goals and current setup of reports will be useful.

Regards,
IvanY
the Telerik team

See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

0
Matthew
Top achievements
Rank 1
answered on 06 Mar 2013, 08:29 PM
I solved it/structured the data to solve it.

Basically, there is a sub-category for every employee. However, a sub-category of with a 0 value gets no heading and no totals. I had to build this into the fields with an "IIF" statement but it works fine. It leaves a space where the sub-heading and totals would be but I can live with that.

I suppose an idea solution would be for the entire section to grow when there is data and shrink when there is none. I did not see that option. Needless to say, the solution works and on to more critical things to solve.
0
Accepted
IvanY
Telerik team
answered on 07 Mar 2013, 08:57 AM
Hi Matthew,

We are glad that you figured it out. Regarding the ideal scenario - once you have prepared your section you can set its height to 1px for example - at runtime it will grow to fit the content in it, but if there is no content it will be left 1px, thus invisible. Since it is not very good to have so small items in the designer you can leave the section with its current height and set it to 1px programmatically, right after the InitializeComponent call in the constructor. When you run the report the section will be initialized with the height set in the designer, then it will be set to 1px and finally during processing it will grow larger (if needed).

I hope that helps.

Regards,
IvanY
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Matthew
Top achievements
Rank 1
answered on 07 Mar 2013, 12:03 PM
That sounds perfect.... Thanks.
Tags
General Discussions
Asked by
Matthew
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or