Showing posts with label filtering. Show all posts
Showing posts with label filtering. Show all posts

Wednesday, March 28, 2012

Grouping output

I have a query that drives the generation of a table. The query is filtered
during output. If the filtering results in no rows being output for the
table, i'd like to put some verbage on the table footer indicating "No
Matching Records" or something similar.
Is there an easy way to do this that i'm missing?
Thanks!
BrianTake a look at NoRows table property.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:e8xqt8gqEHA.324@.TK2MSFTNGP11.phx.gbl...
> I have a query that drives the generation of a table. The query is
filtered
> during output. If the filtering results in no rows being output for the
> table, i'd like to put some verbage on the table footer indicating "No
> Matching Records" or something similar.
> Is there an easy way to do this that i'm missing?
> Thanks!
> Brian
>sql

Monday, March 19, 2012

Group Filtering?

Hi everyone.

Maybe this problem seems too stupid for someone, but I'm going out of my mind.

This is my aim, I want to specify the terms for many groups, for example (nothing to do with the real data):

I have a population data, and I need three groups:

- The first one, with the people who are up to 20 years old and their name is "Jack"

-The second one, with the people who are between 21 and 60 years old, and their weight is over 50 pounds.

-The last one, with the people whose address is "Example st." and live in England.

The problem I'm having, is that I don't know where to put this selection criteria, because the select expert applies the filter to all the data, and I can't use it for another group. Besides, any new group I create is nested with the previous gruop, so the data source is already filtered.

Thanks in advance!

PD: I am using CR embedded in Visual Studio 2005Create a formula @.Groupping like this one:

if {table.person_age}<=20 and {table.person_name}='Jack" then 'Age20_name' else
// or {table.person_name} like '*Jack*' - depend on what you have in your
// {table.person_name}field just the first name or his/her full name
if {table.person_age}>=20 and {table.person_age}<=60 and {tble.person_weight}>=50 then '21_60_50lb' else
if {table.address} like {*Example*st*} and {table.country}='England' then 'addr_country'

Then group your records on that formula.

If you have a situation when the same person has to be included in several groups, then you will need to use a subreports. Show those from group1 in your main report, those records has to be included in Group2 in your 1 subreport and those from the Group3 in your second subreport.

And one thing more: there is no stupid questions aspecially if you're going out of your mind.|||[quote]
If you have a situation when the same person has to be included in several groups, then you will need to use a subreports. Show those from group1 in your main report, those records has to be included in Group2 in your 1 subreport and those from the Group3 in your second subreport.
[quote]

Just a stylistic note.. I would put all of the groups into sub reports, and just have the main report include all of the sub reports (i.e. I would not treat the first group differently...)|||Thank you for your coment, TheCPUWizard.
I agree with you. My point (which may be wrong) was if there are less subreports the main one, it will work faster.

Just a stylistic note.. I would put all of the groups into sub reports, and just have the main report include all of the sub reports (i.e. I would not treat the first group differently...)[/QUOTE]