Tuesday, March 20, 2012

RS:Help

Hello

Does anybody has idea...

my dataset

Field: item_number, amount

data:

item_number, amount

1, 10

2,10

3,10

4,40

5.10

6,20

My report seems like following

item_number, amount

1, 10

2,10

3,10

4,40

subtotal(1-4),70

5.10

6,20

total(1-6),100

Is it possible to get this kind of report.

thanks!

What kind of datasource are you using? SQL Server, Analysis Services, or something else?

Is this grouping defined somewhere in your datasource or do you have to do this manually?

|||

thank you for reply

my datasource is sql server

I get the dataset by the following sql

select item_number, sum(amount) as amount from table1 grouy by item_number

but I must output a subtotal in the middle of report.

|||

if you don't have any groups in your datasource you could use something like

Code Snippet

select

(CASE WHEN item_number BETWEEN 1 AND 4 THEN '1-4' ELSE 'rest' END) as myGroup,

item_number, sum(amount) as amount from table1

grouy by

(CASE WHEN item_number BETWEEN 1 AND 4 THEN '1-4' ELSE 'rest' END),

item_number

but if you don't have 6 items but thousands, this won't do it. Then could also try to use modulo or something like this to create your groups.

After this you can use the regular grouping within reporting services to group on 'myGroup'.

hope this helps

Markus

|||

you are right

it means I can't output a subtotal in the report, I must get a dataset as I hope,

thank you very much

No comments:

Post a Comment