all groups > sql server reporting services > january 2006 >
You're in the

sql server reporting services

group:

Dynamic Columns Report



Dynamic Columns Report Vishal
1/6/2006 11:51:29 AM
sql server reporting services: Hi,

I am trying to design a report with has data for the past 12 months. i.e.
user parameters are Month = 4 & Year = 2005, the report should have columns
from 05/2004 to 04/2005 i.e. past 12 months.

I have managed to get the data using a stored proc, how can get the column
headings to be dynamic ?

something like this
May 2004, June 2004 .............. April 2005

Thanks

Re: Dynamic Columns Report serg
1/8/2006 6:01:38 PM
you need to use a matrix.
The concept is pretty much easy after you get you head around how a
matrix works. Try a tutorial on how to design a matrix and then give a
go using your data.
Re: Dynamic Columns Report JoelBarish
1/9/2006 1:43:10 PM
Did you get this to work? I am having the same problem.... I don't
understand the matrix suggestion.... From what I can tell Matrix
reports still require that you use the Column Headings returned in a
dataset... and they don't change as your data changes.

I guess for a Matrix report you have to flip your time into rows
instead of columns... is that right?

Let me know if you get this working. I am about to pull my hair out.
Re: Dynamic Columns Report MJT
1/26/2006 12:00:03 PM
I dont think the matrix report is as simple as they make it sound. I would
rather have someone post and tell me how to "simulate" a matrix but the
headings have to be dynamic since I wont know what input parms the user will
enter for the start and end dates - I have to do the past 12 months as well
just like the initial post.

Another issue with matrix is that the columns you use for groups dont have
headers which is strange (at least not when I did the wizard)

[quoted text, click to view]
RE: Dynamic Columns Report RayMerckel
3/7/2006 7:06:31 AM
hey man, put this in your stored procedure...


DECLARE @abbrev TABLE(monthid INT, monthname VARCHAR(3))

INSERT INTO @abbrev
VALUES(1,'Jan')
INSERT INTO @abbrev
VALUES(2,'Feb')
INSERT INTO @abbrev
VALUES(3,'Mar')
INSERT INTO @abbrev
VALUES(4,'Apr')
INSERT INTO @abbrev
VALUES(5,'May')
INSERT INTO @abbrev
VALUES(6,'Jun')
INSERT INTO @abbrev
VALUES(7,'Jul')
INSERT INTO @abbrev
VALUES(8,'Aug')
INSERT INTO @abbrev
VALUES(9,'Sep')
INSERT INTO @abbrev
VALUES(10,'Oct')
INSERT INTO @abbrev
VALUES(11,'Nov')
INSERT INTO @abbrev
VALUES(12,'Dec')


and then join the table to your query like:

INNER JOIN @abbrev a
ON LEFT([yourmonthcolumnname],3) = a.monthname

then in the report for the column header properties - visibility code in
[expression]:

=IIF((Parameters!{yourmonthcolumnname].Value)=0,True,False)

peace out...






[quoted text, click to view]
AddThis Social Bookmark Button