views:

371

answers:

1

I can count the rows in the dataset that the table consumes, but this doesn't return the right value as the data in the table is grouped.

I need to know the table size in order to dynamically size a chart that appears along side the table.

CountRows is obviously no good as you have to be in the scope of the table, which I'm not.

Any ideas?

A: 

How about determining the number of rows you'll have this way: [# of Header Rows] + CountRows("[DataSetName]") + CountDistinct(Fields![group1groupby].Value, "[DataSetName]") + CountDistinct(Fields![group2groupby].Value, "[DataSetName]") ... etc?

utexaspunk
CountDistinct: "The value of scope cannot be an expression and must refer to the current scope or a containing scope." I am outside the scope of the original table.
adolf garlic
I just did this in a textbox above a Tablix called "table1" in one of my existing reports which had 4 rows on the header and 3 groupings with header rows below the first two, and it gave me the correct value (the dataset name was "JobCosts"):=4+(CountDistinct(Fields!Cost_Type.Value, "JobCosts") * 2) + (CountDistinct(iif(Fields!Cost_Type.Value = "Labor", Fields!Cost_Type.Value + CStr(Fields!Op.Value), Fields!Cost_Type.Value + CStr(Fields!Op.Value) + " " + CStr(Fields!Seq.Value)), "JobCosts") * 2) + CountRows("JobCosts")Are you trying to do this in the header or something?
utexaspunk
No, not in the header, I'll take another look at this and get back to you.
adolf garlic