user2043123
user2043123

Reputation: 11

How to change the value of heading columns based on a parameter

I created a report where I want to show the heading of a column based on a parameter. I tried using both table and matrix format, but I'm unable to reduce year.

year=2013

For example if I choose 2013 in the report this means it will show the last 10 years in the repor, i.e. 2013,2012,2011,2010,2009,2008, up until 2002.

Upvotes: 0

Views: 1362

Answers (2)

StuartM
StuartM

Reputation: 136

If I understand your question correctly you want to query a database and display the results in a table with a column per year. You can do this by using by using a Matrix object and Column Groups

Add your Matrix object by drag and dropping. Select the Column Group | Group Properties and add a Group Expression.

Use the following code as your Group Expression.

=Year(Fields!Date.Value)

Upvotes: 1

glh
glh

Reputation: 4972

Two fold I'd think:

  1. Alter your sql to accept the parameter and get the bast 10 years in column names 1, 2, etc.
  2. Then use an expression in the header or title similar to =@Parameter!par.Value - Cdec(Data!1.Value) to show headers for 2013 to 2002.

I hope I was clear?

Upvotes: 0

Related Questions