Monday, March 19, 2012

group numbering issue

Hi everyone,

The problem is about numbering groups. I'm trying to display data like this-

1. U.S

1.1 San Francisco

1.1.1 employee1

1.1.2 employee2

1.2 Dallas

1.2.1 employee3

2. UK

2.1 London

2.1.1 employee4

I've tried using RunningValue(1, Sum, "group_name") but it gives erroneous results. I'm using 3 lists, one at each group level. The outermost list (1st list) is grouped by "country" (group_1), 2nd one is grouped by city (group_2) and the innermost (3rd one) by employee name (group_3).

I can't figure whats wrong. Can anyone help me?

Thanks in advance.

We were using Access reports before moving to SQL server, and this numbering works fine in Access. So, I'm wondering if this is a bug in Reporting Services. Is it?

Does anyone know how to do this numbering in SQL Server/Reports?

Thanks

|||

You have to use the CountDistinct aggregation to count the members across the group e.g.

Country Level

= RunningValue(Fields!Country.Value, CountDistinct, Nothing).ToString() + "."

City Level

= RunningValue(Fields!Country.Value, CountDistinct, Nothing).ToString() + "."
+ RunningValue(Fields!City.Value, CountDistinct,"group_country").ToString()

Employee Level

= RunningValue(Fields!Country.Value, CountDistinct, Nothing).ToString() + "."
+ RunningValue(Fields!City.Value, CountDistinct,"group_country").ToString() + "."
+ RunningValue(Fields!Employee.Value, CountDistinct,"group_city").ToString()

|||

Thank you so much. It works!

The SUM aggregation was created by Visual studio when I imported the Access report. That was misleading. Anyways, this issue was bothering me for so long, I'm so glad its resolved finally.

Thanks again.

No comments:

Post a Comment