all groups > sql server reporting services > august 2006 >
You're in the

sql server reporting services

group:

(RS 2000) Row Count in Header?


(RS 2000) Row Count in Header? Vagabond Software
8/10/2006 12:11:46 PM
sql server reporting services:
I am using Reporting Services 2000 and need to know if there is a way to
list the number of rows returned in the Header or Footer?

Any help is greatly appreciated.

- Carl

Re: (RS 2000) Row Count in Header? Josh
8/11/2006 5:56:22 AM

Carl,

If you use the COUNT function in SSRS, it should calculate that for
you. In one of the header/footer cells, make the expression something
like: =Count(Fields!fieldName.Value)

You can make these more informative by putting a descriptor after the
count value like: =Count(Fields!fieldName.Value) &
Iif(Count(Fields!fieldName.Value) = 1, " Employee", " Employees")

Also, the count function just looks within its own scope. If you use a
table header, it looks at the whole table. If you use a group header,
it looks just within its group.

Hope this helps!

-Josh



[quoted text, click to view]
Re: (RS 2000) Row Count in Header? Vagabond Software
8/12/2006 8:39:36 AM
[quoted text, click to view]


Though I couldn't use the COUNT function in the Header or the Footer, I was
able to make space in the Body, above the table, to use the function.
Thanks for the help.

- Carl

Re: (RS 2000) Row Count in Header? Josh
8/13/2006 9:43:11 PM

Carl,

Glad you got it working, but you might want to further investigate the
Count problem... I borrowed a friends workstation that has SSRS 2000
and confirmed that the Count function DOES work in that version of the
product.

I made a simple query that returned 1 field and put a Count expression
in the table footer. It displayed the correct number.

Best wishes!

-Josh


[quoted text, click to view]
Re: (RS 2000) Row Count in Header? Vagabond Software
8/14/2006 1:18:59 PM
[quoted text, click to view]

I will keep playing with it, but if I add a Textbox to the footer and
attempt to use the Count expression in the Value property of that Textbox, I
get a build error something like this:

"The value expression for the textbox 'textbox15' refers to a field. Fields
cannot be used in page headers or footers."

Thanks for all the help.

- carl

Re: (RS 2000) Row Count in Header? Josh
8/15/2006 9:51:24 AM

Carl,

You are adding the textbox to the PAGE footer, not the table footer.
The table is bound to a dataset, so you can reference a field in the
table footer by using "Fields!fieldName.Value" without having to
specify the dataset to which that field belongs.

If you add a textbox to the body, page header, or page footer, you need
to reference the dataset as well. Usually, one you do this, it has to
return a scalar value, so you might be forced to use a First, Last,
Sum, Count, etc. function to condense the result into a single value.
If you use the expression builder (right-click on the textbox and
select Expression), you can click on Datasets on the left and see your
options. If it is a text datatype, I think it defaults to First; if it
is a number datatype, I think it defaults to Sum. The expression will
automatically add the name of the dataset using the correct syntax.

If you need it in the PAGE footer, try this approach. If you meant it
to be a table footer, it should be a simple
Count(Fields!fieldName.Value).

Any closer?

-Josh


[quoted text, click to view]
AddThis Social Bookmark Button