Thursday, February 9, 2012

(RS 2000) Row Count in Header?

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.
- CarlCarl,
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
Vagabond Software wrote:
> 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|||"Josh" <bell.joshua@.gmail.com> wrote in message
news:1155300982.086540.318880@.p79g2000cwp.googlegroups.com...
> 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
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|||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
Vagabond Software wrote:
> "Josh" <bell.joshua@.gmail.com> wrote in message
> news:1155300982.086540.318880@.p79g2000cwp.googlegroups.com...
> >
> > 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
>
> 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|||"Josh" <bell.joshua@.gmail.com> wrote in message
news:1155530591.436146.248650@.75g2000cwc.googlegroups.com...
> 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
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|||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
Vagabond Software wrote:
> "Josh" <bell.joshua@.gmail.com> wrote in message
> news:1155530591.436146.248650@.75g2000cwc.googlegroups.com...
> >
> > 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
> 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

No comments:

Post a Comment