Showing posts with label rdl. Show all posts
Showing posts with label rdl. Show all posts

Tuesday, March 27, 2012

Dynamic RDL group title

I'm new to these forums. If this is not the right place to post this question, please let me know where I should ask. :)

Anyway, I have a report that is grouped something like this:

Team

Location

Score

TEAM 1

#Loc#

#Total#

Home

10

Away

14

Away

8

NULL

0

NULL

0

Home

14

TEAM 2

#Loc#

#Total#

Home

10

Away

14

Home

19

NULL

0

Home

14

TEAM 3

#Loc#

#Total#

Away

7

Away

12

For each team grouping, the header columns needs to perform an action on the grouped records to determine the text.

The #Total# header is easy -- here I want a total of the points ( =Sum(Fields!Points.Value) ). No problem.

The #Loc# header is the problem. What I want to do is to count the number of "Home" values in the group (so Team 1 location reads "Home (2 of 6)", and Team 2 location reads "Home (3 of 5)"). If there are no "Home" values, I want to use the "Away" value (so Team 3 location reads "Away (2 of 2)").

Can someone tell me how I can create a custom code function that will allow me to iterate through the values of the grouped records from the group header textbox? I assume I need to be able to create a custom aggregate function of some kind, but I don't quite know where to begin.

Thanks for your help.

Joe

To simplify the question:

How can I make a group header change to reflect the presence of a specific value from a child row? If I have a group that contains the value "X", how can I change the group header to read "X present"?

Dynamic RDL group title

I'm new to these forums. If this is not the right place to post this question, please let me know where I should ask. :)

Anyway, I have a report that is grouped something like this:

Team

Location

Score

TEAM 1

#Loc#

#Total#

Home

10

Away

14

Away

8

NULL

0

NULL

0

Home

14

TEAM 2

#Loc#

#Total#

Home

10

Away

14

Home

19

NULL

0

Home

14

TEAM 3

#Loc#

#Total#

Away

7

Away

12

For each team grouping, the header columns needs to perform an action on the grouped records to determine the text.

The #Total# header is easy -- here I want a total of the points ( =Sum(Fields!Points.Value) ). No problem.

The #Loc# header is the problem. What I want to do is to count the number of "Home" values in the group (so Team 1 location reads "Home (2 of 6)", and Team 2 location reads "Home (3 of 5)"). If there are no "Home" values, I want to use the "Away" value (so Team 3 location reads "Away (2 of 2)").

Can someone tell me how I can create a custom code function that will allow me to iterate through the values of the grouped records from the group header textbox? I assume I need to be able to create a custom aggregate function of some kind, but I don't quite know where to begin.

Thanks for your help.

Joe

To simplify the question:

How can I make a group header change to reflect the presence of a specific value from a child row? If I have a group that contains the value "X", how can I change the group header to read "X present"?

Thursday, March 22, 2012

Dynamic Parameters

Iam programatically passing parameters to the rdl file, Right now I have four parameters but if I want to have a choice of giveing only 2 or more that 6 parameters then do I need to have a different RDl files one with 2 parameters & another with 6 parameters.
I dont think it is feasible.
Even I should have the flexibility to add or remove the number of parameters dynamically. is ther any wayhow can I sole this situation.

Example: Iam displaying employee table of AdventureWorks database where Iam passing
Parameter 1.DepartmentId
Parameter 2.Title
and for Hiredate
iam passing i.e
Parameter 3. startdate &
Parameter 4.enddate

now that I have to give all the values in parameters to view the report if I want to all the employees in deptid = 5 having Title="Buyer" but not restricting them with date then it is not possible.

I hope the Above situation is clear please feel free if U have any queries.

HELP ME Dude's

Regards

You could assign default values to all 6 parameters at report design time. If a parameter value isn't specified at runtime the default value will be used instead. Just write your SQL query to take the default values into account and not use the param as a filter value - it generally looks like (@.Title = TableName.Title OR @. Title IS NULL) AND ...
The one caveat is that default values can sometimes throw off the optimizer and make for long running queries.