Wednesday, March 7, 2012

How to count the number of textboxes

Hi all,

In the report I am working on, I have a "textbox39" in a table which has groups. I want to have another "textbox29" outside the table to count the number of "textbox39"s that are actually displayed and also the number of "textbox1"s that have a certain value (e.g. "1") in the final report. I tried to use "Sum(ReportItems!textbox39.Value)" but the compiler complains

Error 1 [rsAggregateReportItemInBody] The Value expression for the textbox 'textbox29' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers. d:\perf\perfreportingproject\PerformanceTestDetails v.3.rdl 0 0

Error 7 [rsReportItemReference] The Value expression for the textbox ‘textbox29’ refers to the report item ‘textbox39’. Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope. d:\perf\perfreportingproject\PerformanceTestDetails v.3.rdl 0 0

Anybody has any idea how to solve it?

Thanks so much,

Zhiyan

What are you actually trying to do in terms of the data? Are you trying to count how many groups there are? Or count the number of items in a group? Have you tried using the RowCount or RunningValue function on the data fields?|||

Suppose there is a long expression which displays color "Red" and "Green" in textbox39, I want to count the number of Reds and Greens in my report. Now I can get the total number of textbox39s by multipling the number rows and columns. But when I tried to count the colors, the compiler complains:

Error 1 [rsAggregateofAggregate] The Value expression for the textbox 'textbox27' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. d:\perf\perfreportingproject\PerformanceTestDetails v.3.rdl 0 0

Error 2 [rsAggregateofAggregate] The Value expression for the textbox 'textbox27' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue). Aggregate functions cannot be nested inside other aggregate functions. d:\perf\perfreportingproject\PerformanceTestDetails v.3.rdl 0 0

Any ideas?

Thanks!

No comments:

Post a Comment