How to display subtotals at the end of a Tablix?

81 views Asked by At

I believe I found a way to do the above with SQL but now I believe that my limited knowledge of SSRS and the Tablix control is holding me back.

The solution so far: the way some data is calculated is outside of simple SQL formulas so I'm forced to make an odd union.

select * from (
select fname, lname, null, null, 1 tableNumber
from names
union
select null, null, totalK, totalL, 2 tableNumber
) order by tableNumber

The second table, essentially is a subtotal and so must only appear once and only at the end of the other table.

The problem: I can't seem to get any data from the second table to appear. The first table is simple enough with stuff like...

=Fields!fname.Value

...populating the cells. But I'm not sure what kind of syntax to use to display the values from the second table which only has one value for each of its two lines.

How do I accomplish this with one Tablix?

FNAME        LNAME    (each line of data under these headings is referenced normally)
-----        -----
Alex         Georgian
Other        Person
=====================

Totals:      250      (the totals are in the same table, at specific coordinates)
L total:     99

Edit: I suspect I may need to use Lookup() or something that allows me to find one value, in the DataSet, based on the value of two fields.

0

There are 0 answers