question

ANJI avatar image
ANJI asked

How to Show subreport total in main report on the same column of that row?

Hi i have one main report **report1** and subreport **report2** . For ex: main report will shows all the departments details and with drilldown feature it also shows all the employees under each department(here i created **report2** i.e our subreport,which is expect **deptno** from main report and shows all the emp details under each dept ). my requirement is i need to show **the total salary** of employees in each dept row of main report .(the emp 'sal' column is havingt he report2 ie,subreport) i tried with creating the same dataset of subreport in main report and try to display the total sal in the dept row of main report,but its not working ,because we need to pass the deptno to that dataset as parameter which is the same deptno of that row. please give me some suggestions on this txs @ng
ssrs
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Usman Butt avatar image
Usman Butt answered
It could be quite simple. You can change the current data-set for main report to include the aggregated salary i.e. something like SELECT DEPARTMENTID, DEPARTMENTNAME....REQUIREDFIELDS, (SELECT SUM(SALARY) FROM EMPLOYEETABLE E WHERE E.DEPARTMENTID = D.DEPARTMENTID) DEPTTOTALSALARY FROM DEPARTMENT D This way the parametrized query would work correctly.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ANJI avatar image ANJI commented ·
thanks usman,but it wont works for me bcoz it returns all the emp total salary once,but i need to show dept wise,i.e,the subreport which is running against that deptno. please think it
0 Likes 0 ·
Usman Butt avatar image Usman Butt commented ·
I do not think it will. This will give the department wise salary.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.