Showing posts with label countrows. Show all posts
Showing posts with label countrows. Show all posts

Sunday, February 19, 2012

CountRows()

I've got a simple problem, but because this is my first report, I can't quite figure it out and it's driving me nuts!

I've got an ASP.NET web application with an .RDLC report. The report works fine, i.e. it renders data correctly. However, I cannot get the CountRows() function to work. I've got a cell in the group footer with the following:

=CountRows("grpBuyer")

And I'm getting the compiler error:

The value expression for the textbox XXXX has a scope parameter that is not valid...

"grpBuyer" is what is specified in the Grouping/Sorting property of the group header. I've also tried "TableRow2", which seems to be the name of the group header, but it yeilds the same compiler error.

Some please help!

Thanks, Alex

Hello Alex,

You have to pass group name (which by default is somewhat like "<objectname>_Group") to this function, you can get group name by right clicking on the object(table/matrix/list) and then click on "Group Tab" and there you will see all groups name for that object. You should pass exact name of Group, like i did =CountRows("list1_Details_Group") and it should work fine.

hope this will solve your problem.

CountRows

I have a query structured to return products sold by date. I'm then grouping them by the year they were sold, and totalling up sales..etc. The problem is when I run my sql query that retrieves the data in the SQL designer, the query retrieves 97 rows. When I run the report, and check the number of rows returned (with CountRows()) I get 67. However the remaining 30 rows still show up and are grouped on the next page! Why is this happening? Thanks!It would appear that it's splitting the data into two queries... one with 67 rows and one with 30 rows. I do not want this behavior to occur. What may I do?|||

Try moving the counter out of the group row and put CountRows() in the table row.

Tableheader CountRows()

Group1header "Not here"

data

group1footer

Tablefooter "or here" CountRows()

|||

Thanks for the speedy reply! With that in the table header it's still returning 67/30. I think I've narrowed the problem down to the List grouping expression, but I don't understand why it considers the same value to belong to a different group?

|||It had to do with the list... Removing it and throwing in just a table fixed the problem. When would you ever need to use a list? Thanks Smile