Pergunta

I'm using Sql Server Reporting Service 2008. Let's say I have a tablix as shown below:

Items   2009    2010    2011
A       10      20      30
B       100     200     300
C       1000    2000    3000

All the values in the year column will be generated dynamically, following years like 2012 and 2013 will be added to the back.

Now that if a particular row item has multiple records in the database, it should be displayed in the row. For example, the Row Item 'C', with ID (report parameter) = 3, shall return 3 records, as shown below:

Items       2009        2010         2011
A           10          20           30
B           100         200          300
C, C1, C2   1000,200,30 2000,300,40  3000,400,50

How do I achieve that? Should I do changes in my stored procedure? Perhaps adding a loop? Or should I specify the tablix expression in SSRS2008?

ps: My stored procedure only includes common select statements. Eg:

Select A, B, C from Products where ID = '@ID'; 
Foi útil?

Solução

You would need to add another column group to push the values out. For example, you are grouping on year. You need to add another column group by year and row value for [Items] and add headers to make the first row group the year and the following = Year+ Items(x).

2009[1] 2010[1][2][3] 2011[1]
1       1    2  3  4  1     
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top