Showing posts with label datasets. Show all posts
Showing posts with label datasets. Show all posts

Monday, March 26, 2012

Parent Expression

I have created a Report that has many Datasets and they each link to an individual table in the Report. I need the tables to only show the Data that relates to a Parent field on the Report.

E.G.

John Smith (parent)
Tasks 3
Task1
Task2
Task3
Appointments 10
... etc

Joe Bloggs (parent field)
Tasks 2
Task1
Task2
Appointments 5
... etc

I dont know how to make all the Datasets for the individual tables look at the name field. I can only do this if I use one Dataset or use a Parameter. I have tried using Lists but they dont seem to do what I need to do.

Thanks
NJA

What you are describing is a cross-dataset join. This is not natively supported in Reporting Services. You will either need to do the join in your query or use subreports (which are less efficient).

Monday, March 12, 2012

Parameters Select one or all

I have 2 datasets. One contains the information for the report and the other
contains a list of available companies.
In the report parameter area I have the company as a parameter and 'from
query' selected.
When the report runs, the user is prompted to 'Select a Company' from a drop
down list.
I want the user to be able to select one company or all companies. How do I
make this happen?On Mar 2, 2:49 pm, DONNA <D...@.discussions.microsoft.com> wrote:
> I have 2 datasets. One contains the information for the report and the other
> contains a list of available companies.
> In the report parameter area I have the company as a parameter and 'from
> query' selected.
> When the report runs, the user is prompted to 'Select a Company' from a drop
> down list.
> I want the user to be able to select one company or all companies. How do I
> make this happen?
Hi donna...what version of SSRS are you using? In SSRS 2005 you can
make the drop down a multi-value select by checking the 'multi-value'
box inside the Report Parameters window. This also would require that
your stored procedure be able to process multiple values inside that
parameter. If this is an option I would suggest following the steps
layed out by Bruce Loehle-Cogner here:
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/e832f21f9400af08/5b6ea54b15e7fb3f?lnk=gst&q=2005+multi-value+select+list&rnum=5&hl=en#5b6ea54b15e7fb3f
Otherwise if you are using SSRS 2000, or don't want to allow a multi-
select, you could make the query returning the values for the drop
down include a NULL. So something like...
/***/
select NULL as 'value', ' - All - ' as 'label'
union
/* Normal select for list of companies here */
select ... from ...
/***/
then in your stored proc that returns the main set of data have
something like the following in your where clause
/***/
select
...
from
...
where
...
(@.company = company_column or @.company is null)
/***/
This should then return results for all companies if @.company is
null.
Hope this helps!
--
Ben Sullins|||Thanks Ben,
I'm on RS 2000. Your comments were helpfull. I successfully used the UNION
statement on varchar fields. I now have this issue. On a int datatype field
I am receiving the following message: Syntax error converting the varchar
value 'ALL PROJECTS' to a column of data type int. Following is my code.
SELECT PROJECT_ID AS PROJECT_ID_KEY, PROJECT_ID
FROM ProjectActualCost
UNION
SELECT - 1, 'ALL PROJECTS'
Any ideas?
Thanks,
Donna
"sullins602" wrote:
> On Mar 2, 2:49 pm, DONNA <D...@.discussions.microsoft.com> wrote:
> > I have 2 datasets. One contains the information for the report and the other
> > contains a list of available companies.
> >
> > In the report parameter area I have the company as a parameter and 'from
> > query' selected.
> >
> > When the report runs, the user is prompted to 'Select a Company' from a drop
> > down list.
> >
> > I want the user to be able to select one company or all companies. How do I
> > make this happen?
> Hi donna...what version of SSRS are you using? In SSRS 2005 you can
> make the drop down a multi-value select by checking the 'multi-value'
> box inside the Report Parameters window. This also would require that
> your stored procedure be able to process multiple values inside that
> parameter. If this is an option I would suggest following the steps
> layed out by Bruce Loehle-Cogner here:
> http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/e832f21f9400af08/5b6ea54b15e7fb3f?lnk=gst&q=2005+multi-value+select+list&rnum=5&hl=en#5b6ea54b15e7fb3f
>
> Otherwise if you are using SSRS 2000, or don't want to allow a multi-
> select, you could make the query returning the values for the drop
> down include a NULL. So something like...
> /***/
> select NULL as 'value', ' - All - ' as 'label'
> union
> /* Normal select for list of companies here */
> select ... from ...
> /***/
> then in your stored proc that returns the main set of data have
> something like the following in your where clause
> /***/
> select
> ...
> from
> ...
> where
> ...
> (@.company = company_column or @.company is null)
> /***/
> This should then return results for all companies if @.company is
> null.
> Hope this helps!
> --
> Ben Sullins
>|||SELECT PROJECT_ID AS value, convert(varchar(20),PROJECT_ID) as label
FROM ProjectActualCost
UNION
SELECT - 1 as value, 'ALL PROJECTS' as label
Also, I like to use value and label when creating this, it makes it real
obvious which one you are using when you are filling in the properties for
the parameter.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"DONNA" <DONNA@.discussions.microsoft.com> wrote in message
news:417636EC-544E-40AF-A495-3BD6A582E498@.microsoft.com...
> Thanks Ben,
> I'm on RS 2000. Your comments were helpfull. I successfully used the
> UNION
> statement on varchar fields. I now have this issue. On a int datatype
> field
> I am receiving the following message: Syntax error converting the varchar
> value 'ALL PROJECTS' to a column of data type int. Following is my code.
> SELECT PROJECT_ID AS PROJECT_ID_KEY, PROJECT_ID
> FROM ProjectActualCost
> UNION
> SELECT - 1, 'ALL PROJECTS'
> Any ideas?
> Thanks,
> Donna
>
> "sullins602" wrote:
>> On Mar 2, 2:49 pm, DONNA <D...@.discussions.microsoft.com> wrote:
>> > I have 2 datasets. One contains the information for the report and the
>> > other
>> > contains a list of available companies.
>> >
>> > In the report parameter area I have the company as a parameter and
>> > 'from
>> > query' selected.
>> >
>> > When the report runs, the user is prompted to 'Select a Company' from a
>> > drop
>> > down list.
>> >
>> > I want the user to be able to select one company or all companies. How
>> > do I
>> > make this happen?
>> Hi donna...what version of SSRS are you using? In SSRS 2005 you can
>> make the drop down a multi-value select by checking the 'multi-value'
>> box inside the Report Parameters window. This also would require that
>> your stored procedure be able to process multiple values inside that
>> parameter. If this is an option I would suggest following the steps
>> layed out by Bruce Loehle-Cogner here:
>> http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/e832f21f9400af08/5b6ea54b15e7fb3f?lnk=gst&q=2005+multi-value+select+list&rnum=5&hl=en#5b6ea54b15e7fb3f
>>
>> Otherwise if you are using SSRS 2000, or don't want to allow a multi-
>> select, you could make the query returning the values for the drop
>> down include a NULL. So something like...
>> /***/
>> select NULL as 'value', ' - All - ' as 'label'
>> union
>> /* Normal select for list of companies here */
>> select ... from ...
>> /***/
>> then in your stored proc that returns the main set of data have
>> something like the following in your where clause
>> /***/
>> select
>> ...
>> from
>> ...
>> where
>> ...
>> (@.company = company_column or @.company is null)
>> /***/
>> This should then return results for all companies if @.company is
>> null.
>> Hope this helps!
>> --
>> Ben Sullins
>>|||How do I manage this same concept with a datetime value? I'm having some
problems with an error related to converting to datetime from string.
Query parameter:
SELECT DISTINCT sent_date as value, convert(varchar(30),sent_date) as
sent_date
FROM o_dpl_deployment
WHERE sent_date IS NOT NULL
UNION
SELECT '1753-01-01' as value, 'All Deployment Dates' as sent_date
Main Query:
...
((D.sent_date = @.sent_date) OR (@.sent_date ='1753-01-01')) AND
...
"Bruce L-C [MVP]" wrote:
> SELECT PROJECT_ID AS value, convert(varchar(20),PROJECT_ID) as label
> FROM ProjectActualCost
> UNION
> SELECT - 1 as value, 'ALL PROJECTS' as label
> Also, I like to use value and label when creating this, it makes it real
> obvious which one you are using when you are filling in the properties for
> the parameter.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "DONNA" <DONNA@.discussions.microsoft.com> wrote in message
> news:417636EC-544E-40AF-A495-3BD6A582E498@.microsoft.com...
> > Thanks Ben,
> >
> > I'm on RS 2000. Your comments were helpfull. I successfully used the
> > UNION
> > statement on varchar fields. I now have this issue. On a int datatype
> > field
> > I am receiving the following message: Syntax error converting the varchar
> > value 'ALL PROJECTS' to a column of data type int. Following is my code.
> >
> > SELECT PROJECT_ID AS PROJECT_ID_KEY, PROJECT_ID
> > FROM ProjectActualCost
> > UNION
> > SELECT - 1, 'ALL PROJECTS'
> >
> > Any ideas?
> >
> > Thanks,
> >
> > Donna
> >
> >
> >
> > "sullins602" wrote:
> >
> >> On Mar 2, 2:49 pm, DONNA <D...@.discussions.microsoft.com> wrote:
> >> > I have 2 datasets. One contains the information for the report and the
> >> > other
> >> > contains a list of available companies.
> >> >
> >> > In the report parameter area I have the company as a parameter and
> >> > 'from
> >> > query' selected.
> >> >
> >> > When the report runs, the user is prompted to 'Select a Company' from a
> >> > drop
> >> > down list.
> >> >
> >> > I want the user to be able to select one company or all companies. How
> >> > do I
> >> > make this happen?
> >>
> >> Hi donna...what version of SSRS are you using? In SSRS 2005 you can
> >> make the drop down a multi-value select by checking the 'multi-value'
> >> box inside the Report Parameters window. This also would require that
> >> your stored procedure be able to process multiple values inside that
> >> parameter. If this is an option I would suggest following the steps
> >> layed out by Bruce Loehle-Cogner here:
> >>
> >> http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/e832f21f9400af08/5b6ea54b15e7fb3f?lnk=gst&q=2005+multi-value+select+list&rnum=5&hl=en#5b6ea54b15e7fb3f
> >>
> >>
> >> Otherwise if you are using SSRS 2000, or don't want to allow a multi-
> >> select, you could make the query returning the values for the drop
> >> down include a NULL. So something like...
> >>
> >> /***/
> >> select NULL as 'value', ' - All - ' as 'label'
> >> union
> >> /* Normal select for list of companies here */
> >> select ... from ...
> >> /***/
> >>
> >> then in your stored proc that returns the main set of data have
> >> something like the following in your where clause
> >>
> >> /***/
> >> select
> >> ...
> >> from
> >> ...
> >> where
> >> ...
> >> (@.company = company_column or @.company is null)
> >> /***/
> >>
> >> This should then return results for all companies if @.company is
> >> null.
> >>
> >> Hope this helps!
> >> --
> >> Ben Sullins
> >>
> >>
>
>|||SELECT convert(datetime,'1753-01-01') as value, 'All Deployment Dates' as
sent_date
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stephanie" <Stephanie@.discussions.microsoft.com> wrote in message
news:49D8B8E1-7657-4D1D-92D5-38D3ED874751@.microsoft.com...
> How do I manage this same concept with a datetime value? I'm having some
> problems with an error related to converting to datetime from string.
> Query parameter:
> SELECT DISTINCT sent_date as value, convert(varchar(30),sent_date) as
> sent_date
> FROM o_dpl_deployment
> WHERE sent_date IS NOT NULL
> UNION
> SELECT '1753-01-01' as value, 'All Deployment Dates' as sent_date
> Main Query:
> ...
> ((D.sent_date = @.sent_date) OR (@.sent_date => '1753-01-01')) AND
> ...
>
> "Bruce L-C [MVP]" wrote:
>> SELECT PROJECT_ID AS value, convert(varchar(20),PROJECT_ID) as label
>> FROM ProjectActualCost
>> UNION
>> SELECT - 1 as value, 'ALL PROJECTS' as label
>> Also, I like to use value and label when creating this, it makes it real
>> obvious which one you are using when you are filling in the properties
>> for
>> the parameter.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "DONNA" <DONNA@.discussions.microsoft.com> wrote in message
>> news:417636EC-544E-40AF-A495-3BD6A582E498@.microsoft.com...
>> > Thanks Ben,
>> >
>> > I'm on RS 2000. Your comments were helpfull. I successfully used the
>> > UNION
>> > statement on varchar fields. I now have this issue. On a int datatype
>> > field
>> > I am receiving the following message: Syntax error converting the
>> > varchar
>> > value 'ALL PROJECTS' to a column of data type int. Following is my
>> > code.
>> >
>> > SELECT PROJECT_ID AS PROJECT_ID_KEY, PROJECT_ID
>> > FROM ProjectActualCost
>> > UNION
>> > SELECT - 1, 'ALL PROJECTS'
>> >
>> > Any ideas?
>> >
>> > Thanks,
>> >
>> > Donna
>> >
>> >
>> >
>> > "sullins602" wrote:
>> >
>> >> On Mar 2, 2:49 pm, DONNA <D...@.discussions.microsoft.com> wrote:
>> >> > I have 2 datasets. One contains the information for the report and
>> >> > the
>> >> > other
>> >> > contains a list of available companies.
>> >> >
>> >> > In the report parameter area I have the company as a parameter and
>> >> > 'from
>> >> > query' selected.
>> >> >
>> >> > When the report runs, the user is prompted to 'Select a Company'
>> >> > from a
>> >> > drop
>> >> > down list.
>> >> >
>> >> > I want the user to be able to select one company or all companies.
>> >> > How
>> >> > do I
>> >> > make this happen?
>> >>
>> >> Hi donna...what version of SSRS are you using? In SSRS 2005 you can
>> >> make the drop down a multi-value select by checking the 'multi-value'
>> >> box inside the Report Parameters window. This also would require that
>> >> your stored procedure be able to process multiple values inside that
>> >> parameter. If this is an option I would suggest following the steps
>> >> layed out by Bruce Loehle-Cogner here:
>> >>
>> >> http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/e832f21f9400af08/5b6ea54b15e7fb3f?lnk=gst&q=2005+multi-value+select+list&rnum=5&hl=en#5b6ea54b15e7fb3f
>> >>
>> >>
>> >> Otherwise if you are using SSRS 2000, or don't want to allow a multi-
>> >> select, you could make the query returning the values for the drop
>> >> down include a NULL. So something like...
>> >>
>> >> /***/
>> >> select NULL as 'value', ' - All - ' as 'label'
>> >> union
>> >> /* Normal select for list of companies here */
>> >> select ... from ...
>> >> /***/
>> >>
>> >> then in your stored proc that returns the main set of data have
>> >> something like the following in your where clause
>> >>
>> >> /***/
>> >> select
>> >> ...
>> >> from
>> >> ...
>> >> where
>> >> ...
>> >> (@.company = company_column or @.company is null)
>> >> /***/
>> >>
>> >> This should then return results for all companies if @.company is
>> >> null.
>> >>
>> >> Hope this helps!
>> >> --
>> >> Ben Sullins
>> >>
>> >>
>>

Parameters Question! Help Please.

So I have created 6 or 7 drop down lists using seperate datasets for each
drop down and the value field is an integer value and the label field is a
text value. The dropdowns all are set to have a datatype of integer and
allow null value is checked. I also have default value on all of the drop
downs set to 0 which is the ALL value. Now the issue, how can I add them to
the where clause in the data view screen? As soon as I add them to the where
clause and ALL (0) is selected there is no way for me to select all values
back. I don't want all the fields to be manditory, that's why I added the
ALL(0) option. I know I could probably write a stored procedure to do this,
but I was wondering if anyone else has found a way around the issue. Thanks,
all help is greatly appreciatedI'm not sure I understand completely. But here's what I do.
(I use oracle, hope you can translate)
I always add a "All" to my parameters list (suppose the parameter name is
parameter1):
Select value, label from parameters
union
Select -1, 'All' from dual
In the data-queries I than write:
Select ...
from table1
where
(table1.xxx = :parameter1 or :parameter1 = -1)
(oracle uses ":" to denote a parameter, in SQLServer that is a "?" I think)
"Eddie J" wrote:
> So I have created 6 or 7 drop down lists using seperate datasets for each
> drop down and the value field is an integer value and the label field is a
> text value. The dropdowns all are set to have a datatype of integer and
> allow null value is checked. I also have default value on all of the drop
> downs set to 0 which is the ALL value. Now the issue, how can I add them to
> the where clause in the data view screen? As soon as I add them to the where
> clause and ALL (0) is selected there is no way for me to select all values
> back. I don't want all the fields to be manditory, that's why I added the
> ALL(0) option. I know I could probably write a stored procedure to do this,
> but I was wondering if anyone else has found a way around the issue. Thanks,
> all help is greatly appreciated|||Thanks for your response, but in oracle does -1 return everything for that
column? I need All to actually return all? It looks like to me that -1
would just return what ever text is associated to the value -1. Thanks
again, I appreciate your help.
"Antoon" wrote:
> I'm not sure I understand completely. But here's what I do.
> (I use oracle, hope you can translate)
> I always add a "All" to my parameters list (suppose the parameter name is
> parameter1):
> Select value, label from parameters
> union
> Select -1, 'All' from dual
> In the data-queries I than write:
> Select ...
> from table1
> where
> (table1.xxx = :parameter1 or :parameter1 = -1)
> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I think)
> "Eddie J" wrote:
> > So I have created 6 or 7 drop down lists using seperate datasets for each
> > drop down and the value field is an integer value and the label field is a
> > text value. The dropdowns all are set to have a datatype of integer and
> > allow null value is checked. I also have default value on all of the drop
> > downs set to 0 which is the ALL value. Now the issue, how can I add them to
> > the where clause in the data view screen? As soon as I add them to the where
> > clause and ALL (0) is selected there is no way for me to select all values
> > back. I don't want all the fields to be manditory, that's why I added the
> > ALL(0) option. I know I could probably write a stored procedure to do this,
> > but I was wondering if anyone else has found a way around the issue. Thanks,
> > all help is greatly appreciated|||I too use this technique. It does not have to be -1, what it should be to
prevent confusion is a value that does not exist in your data. If it is a
text field I use the word All instead of -1. Here is the key point, you
have an or. The first part of the or statement is looking for a specific
value, the next is seeing if the parameter = this particular value
(table1.xxx = :parameter1 or :parameter1 = -1)
Note the different position the parameter is put (whether it is to the left
or right of the equal size).
Give it a try, it works great.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> Thanks for your response, but in oracle does -1 return everything for that
> column? I need All to actually return all? It looks like to me that -1
> would just return what ever text is associated to the value -1. Thanks
> again, I appreciate your help.
> "Antoon" wrote:
>> I'm not sure I understand completely. But here's what I do.
>> (I use oracle, hope you can translate)
>> I always add a "All" to my parameters list (suppose the parameter name is
>> parameter1):
>> Select value, label from parameters
>> union
>> Select -1, 'All' from dual
>> In the data-queries I than write:
>> Select ...
>> from table1
>> where
>> (table1.xxx = :parameter1 or :parameter1 = -1)
>> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
>> think)
>> "Eddie J" wrote:
>> > So I have created 6 or 7 drop down lists using seperate datasets for
>> > each
>> > drop down and the value field is an integer value and the label field
>> > is a
>> > text value. The dropdowns all are set to have a datatype of integer
>> > and
>> > allow null value is checked. I also have default value on all of the
>> > drop
>> > downs set to 0 which is the ALL value. Now the issue, how can I add
>> > them to
>> > the where clause in the data view screen? As soon as I add them to the
>> > where
>> > clause and ALL (0) is selected there is no way for me to select all
>> > values
>> > back. I don't want all the fields to be manditory, that's why I added
>> > the
>> > ALL(0) option. I know I could probably write a stored procedure to do
>> > this,
>> > but I was wondering if anyone else has found a way around the issue.
>> > Thanks,
>> > all help is greatly appreciated|||Bruce, Antoon,
Thank you so much for you help, this seems to be a great start, but I'm
still running into some issues. Here is the way it looks with 3 parameters
w/ 1 dropdown:
WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=@.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
but as soon as I add another dropdown to the where clause like:
And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
the dataview automatically changes the where clause to look like this:
WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=@.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
(pj.BrandManagerID = @.ABM)
OR
(pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
Which would never give me the results I'm look for. Any ideas? Thanks
again, I'm in learning mode with reporting services.
"Bruce L-C [MVP]" wrote:
> I too use this technique. It does not have to be -1, what it should be to
> prevent confusion is a value that does not exist in your data. If it is a
> text field I use the word All instead of -1. Here is the key point, you
> have an or. The first part of the or statement is looking for a specific
> value, the next is seeing if the parameter = this particular value
> (table1.xxx = :parameter1 or :parameter1 = -1)
> Note the different position the parameter is put (whether it is to the left
> or right of the equal size).
> Give it a try, it works great.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > Thanks for your response, but in oracle does -1 return everything for that
> > column? I need All to actually return all? It looks like to me that -1
> > would just return what ever text is associated to the value -1. Thanks
> > again, I appreciate your help.
> >
> > "Antoon" wrote:
> >
> >> I'm not sure I understand completely. But here's what I do.
> >> (I use oracle, hope you can translate)
> >>
> >> I always add a "All" to my parameters list (suppose the parameter name is
> >> parameter1):
> >> Select value, label from parameters
> >> union
> >> Select -1, 'All' from dual
> >>
> >> In the data-queries I than write:
> >> Select ...
> >> from table1
> >> where
> >> (table1.xxx = :parameter1 or :parameter1 = -1)
> >>
> >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> >> think)
> >>
> >> "Eddie J" wrote:
> >>
> >> > So I have created 6 or 7 drop down lists using seperate datasets for
> >> > each
> >> > drop down and the value field is an integer value and the label field
> >> > is a
> >> > text value. The dropdowns all are set to have a datatype of integer
> >> > and
> >> > allow null value is checked. I also have default value on all of the
> >> > drop
> >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> >> > them to
> >> > the where clause in the data view screen? As soon as I add them to the
> >> > where
> >> > clause and ALL (0) is selected there is no way for me to select all
> >> > values
> >> > back. I don't want all the fields to be manditory, that's why I added
> >> > the
> >> > ALL(0) option. I know I could probably write a stored procedure to do
> >> > this,
> >> > but I was wondering if anyone else has found a way around the issue.
> >> > Thanks,
> >> > all help is greatly appreciated
>
>|||try using "(pj.InitiationDate between @.StartDate AND (@.EndDate + 1))" instead
of the => and <= expression
--
"Everyone knows something you don't know"
"Eddie J" wrote:
> Bruce, Antoon,
> Thank you so much for you help, this seems to be a great start, but I'm
> still running into some issues. Here is the way it looks with 3 parameters
> w/ 1 dropdown:
> WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
> but as soon as I add another dropdown to the where clause like:
> And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
> the dataview automatically changes the where clause to look like this:
> WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
> (pj.BrandManagerID = @.ABM)
> OR
> (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
> AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
> Which would never give me the results I'm look for. Any ideas? Thanks
> again, I'm in learning mode with reporting services.
>
> "Bruce L-C [MVP]" wrote:
> > I too use this technique. It does not have to be -1, what it should be to
> > prevent confusion is a value that does not exist in your data. If it is a
> > text field I use the word All instead of -1. Here is the key point, you
> > have an or. The first part of the or statement is looking for a specific
> > value, the next is seeing if the parameter = this particular value
> >
> > (table1.xxx = :parameter1 or :parameter1 = -1)
> >
> > Note the different position the parameter is put (whether it is to the left
> > or right of the equal size).
> >
> > Give it a try, it works great.
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> > news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > > Thanks for your response, but in oracle does -1 return everything for that
> > > column? I need All to actually return all? It looks like to me that -1
> > > would just return what ever text is associated to the value -1. Thanks
> > > again, I appreciate your help.
> > >
> > > "Antoon" wrote:
> > >
> > >> I'm not sure I understand completely. But here's what I do.
> > >> (I use oracle, hope you can translate)
> > >>
> > >> I always add a "All" to my parameters list (suppose the parameter name is
> > >> parameter1):
> > >> Select value, label from parameters
> > >> union
> > >> Select -1, 'All' from dual
> > >>
> > >> In the data-queries I than write:
> > >> Select ...
> > >> from table1
> > >> where
> > >> (table1.xxx = :parameter1 or :parameter1 = -1)
> > >>
> > >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> > >> think)
> > >>
> > >> "Eddie J" wrote:
> > >>
> > >> > So I have created 6 or 7 drop down lists using seperate datasets for
> > >> > each
> > >> > drop down and the value field is an integer value and the label field
> > >> > is a
> > >> > text value. The dropdowns all are set to have a datatype of integer
> > >> > and
> > >> > allow null value is checked. I also have default value on all of the
> > >> > drop
> > >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> > >> > them to
> > >> > the where clause in the data view screen? As soon as I add them to the
> > >> > where
> > >> > clause and ALL (0) is selected there is no way for me to select all
> > >> > values
> > >> > back. I don't want all the fields to be manditory, that's why I added
> > >> > the
> > >> > ALL(0) option. I know I could probably write a stored procedure to do
> > >> > this,
> > >> > but I was wondering if anyone else has found a way around the issue.
> > >> > Thanks,
> > >> > all help is greatly appreciated
> >
> >
> >|||David thanks for you help, but unfortunately it doesn't help? I believe the
engine in the background of the Dataview is re-working my sql query for some
reason. So this works fine (perfect):
(pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division =@.division OR @.Division = 0)
but as soon as I add this to the where clause
and (pj.BrandManagerID = @.ABM or @.ABM = 0) then engine reworks my query to
something that doesn't work:) Like this:
(pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division =@.division OR @.Division = 0) AND (pj.BrandManagerID = @.ABM) OR
(pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division =@.division OR @.Division = 0) AND (@.ABM = 0)
Any help is greatly appreciated! I am working on just creating a stored
procedure to do all this work, but it sure would be good to know if there is
a way to do it with out a stored procedure. Thanks in advance.
Eddie
"David Bienstock" wrote:
> try using "(pj.InitiationDate between @.StartDate AND (@.EndDate + 1))" instead
> of the => and <= expression
> --
> "Everyone knows something you don't know"
>
> "Eddie J" wrote:
> > Bruce, Antoon,
> > Thank you so much for you help, this seems to be a great start, but I'm
> > still running into some issues. Here is the way it looks with 3 parameters
> > w/ 1 dropdown:
> > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
> > but as soon as I add another dropdown to the where clause like:
> > And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
> > the dataview automatically changes the where clause to look like this:
> > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
> > (pj.BrandManagerID = @.ABM)
> > OR
> > (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
> > AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
> > Which would never give me the results I'm look for. Any ideas? Thanks
> > again, I'm in learning mode with reporting services.
> >
> >
> > "Bruce L-C [MVP]" wrote:
> >
> > > I too use this technique. It does not have to be -1, what it should be to
> > > prevent confusion is a value that does not exist in your data. If it is a
> > > text field I use the word All instead of -1. Here is the key point, you
> > > have an or. The first part of the or statement is looking for a specific
> > > value, the next is seeing if the parameter = this particular value
> > >
> > > (table1.xxx = :parameter1 or :parameter1 = -1)
> > >
> > > Note the different position the parameter is put (whether it is to the left
> > > or right of the equal size).
> > >
> > > Give it a try, it works great.
> > >
> > > --
> > > Bruce Loehle-Conger
> > > MVP SQL Server Reporting Services
> > >
> > > "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> > > news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > > > Thanks for your response, but in oracle does -1 return everything for that
> > > > column? I need All to actually return all? It looks like to me that -1
> > > > would just return what ever text is associated to the value -1. Thanks
> > > > again, I appreciate your help.
> > > >
> > > > "Antoon" wrote:
> > > >
> > > >> I'm not sure I understand completely. But here's what I do.
> > > >> (I use oracle, hope you can translate)
> > > >>
> > > >> I always add a "All" to my parameters list (suppose the parameter name is
> > > >> parameter1):
> > > >> Select value, label from parameters
> > > >> union
> > > >> Select -1, 'All' from dual
> > > >>
> > > >> In the data-queries I than write:
> > > >> Select ...
> > > >> from table1
> > > >> where
> > > >> (table1.xxx = :parameter1 or :parameter1 = -1)
> > > >>
> > > >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> > > >> think)
> > > >>
> > > >> "Eddie J" wrote:
> > > >>
> > > >> > So I have created 6 or 7 drop down lists using seperate datasets for
> > > >> > each
> > > >> > drop down and the value field is an integer value and the label field
> > > >> > is a
> > > >> > text value. The dropdowns all are set to have a datatype of integer
> > > >> > and
> > > >> > allow null value is checked. I also have default value on all of the
> > > >> > drop
> > > >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> > > >> > them to
> > > >> > the where clause in the data view screen? As soon as I add them to the
> > > >> > where
> > > >> > clause and ALL (0) is selected there is no way for me to select all
> > > >> > values
> > > >> > back. I don't want all the fields to be manditory, that's why I added
> > > >> > the
> > > >> > ALL(0) option. I know I could probably write a stored procedure to do
> > > >> > this,
> > > >> > but I was wondering if anyone else has found a way around the issue.
> > > >> > Thanks,
> > > >> > all help is greatly appreciated
> > >
> > >
> > >|||I know what you're saying but I think if you try
(pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division =@.division OR @.Division = 0) it may not re-work it
"Eddie J" wrote:
> David thanks for you help, but unfortunately it doesn't help? I believe the
> engine in the background of the Dataview is re-working my sql query for some
> reason. So this works fine (perfect):
> (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => @.division OR @.Division = 0)
> but as soon as I add this to the where clause
> and (pj.BrandManagerID = @.ABM or @.ABM = 0) then engine reworks my query to
> something that doesn't work:) Like this:
> (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => @.division OR @.Division = 0) AND (pj.BrandManagerID = @.ABM) OR
> (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => @.division OR @.Division = 0) AND (@.ABM = 0)
> Any help is greatly appreciated! I am working on just creating a stored
> procedure to do all this work, but it sure would be good to know if there is
> a way to do it with out a stored procedure. Thanks in advance.
> Eddie
>
> "David Bienstock" wrote:
> > try using "(pj.InitiationDate between @.StartDate AND (@.EndDate + 1))" instead
> > of the => and <= expression
> > --
> > "Everyone knows something you don't know"
> >
> >
> > "Eddie J" wrote:
> >
> > > Bruce, Antoon,
> > > Thank you so much for you help, this seems to be a great start, but I'm
> > > still running into some issues. Here is the way it looks with 3 parameters
> > > w/ 1 dropdown:
> > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
> > > but as soon as I add another dropdown to the where clause like:
> > > And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
> > > the dataview automatically changes the where clause to look like this:
> > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
> > > (pj.BrandManagerID = @.ABM)
> > > OR
> > > (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
> > > AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
> > > Which would never give me the results I'm look for. Any ideas? Thanks
> > > again, I'm in learning mode with reporting services.
> > >
> > >
> > > "Bruce L-C [MVP]" wrote:
> > >
> > > > I too use this technique. It does not have to be -1, what it should be to
> > > > prevent confusion is a value that does not exist in your data. If it is a
> > > > text field I use the word All instead of -1. Here is the key point, you
> > > > have an or. The first part of the or statement is looking for a specific
> > > > value, the next is seeing if the parameter = this particular value
> > > >
> > > > (table1.xxx = :parameter1 or :parameter1 = -1)
> > > >
> > > > Note the different position the parameter is put (whether it is to the left
> > > > or right of the equal size).
> > > >
> > > > Give it a try, it works great.
> > > >
> > > > --
> > > > Bruce Loehle-Conger
> > > > MVP SQL Server Reporting Services
> > > >
> > > > "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> > > > news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > > > > Thanks for your response, but in oracle does -1 return everything for that
> > > > > column? I need All to actually return all? It looks like to me that -1
> > > > > would just return what ever text is associated to the value -1. Thanks
> > > > > again, I appreciate your help.
> > > > >
> > > > > "Antoon" wrote:
> > > > >
> > > > >> I'm not sure I understand completely. But here's what I do.
> > > > >> (I use oracle, hope you can translate)
> > > > >>
> > > > >> I always add a "All" to my parameters list (suppose the parameter name is
> > > > >> parameter1):
> > > > >> Select value, label from parameters
> > > > >> union
> > > > >> Select -1, 'All' from dual
> > > > >>
> > > > >> In the data-queries I than write:
> > > > >> Select ...
> > > > >> from table1
> > > > >> where
> > > > >> (table1.xxx = :parameter1 or :parameter1 = -1)
> > > > >>
> > > > >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> > > > >> think)
> > > > >>
> > > > >> "Eddie J" wrote:
> > > > >>
> > > > >> > So I have created 6 or 7 drop down lists using seperate datasets for
> > > > >> > each
> > > > >> > drop down and the value field is an integer value and the label field
> > > > >> > is a
> > > > >> > text value. The dropdowns all are set to have a datatype of integer
> > > > >> > and
> > > > >> > allow null value is checked. I also have default value on all of the
> > > > >> > drop
> > > > >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> > > > >> > them to
> > > > >> > the where clause in the data view screen? As soon as I add them to the
> > > > >> > where
> > > > >> > clause and ALL (0) is selected there is no way for me to select all
> > > > >> > values
> > > > >> > back. I don't want all the fields to be manditory, that's why I added
> > > > >> > the
> > > > >> > ALL(0) option. I know I could probably write a stored procedure to do
> > > > >> > this,
> > > > >> > but I was wondering if anyone else has found a way around the issue.
> > > > >> > Thanks,
> > > > >> > all help is greatly appreciated
> > > >
> > > >
> > > >|||David, I did try it but received the same results. Thanks for you help!
"David Bienstock" wrote:
> I know what you're saying but I think if you try
> (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => @.division OR @.Division = 0) it may not re-work it
> "Eddie J" wrote:
> > David thanks for you help, but unfortunately it doesn't help? I believe the
> > engine in the background of the Dataview is re-working my sql query for some
> > reason. So this works fine (perfect):
> > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > @.division OR @.Division = 0)
> > but as soon as I add this to the where clause
> > and (pj.BrandManagerID = @.ABM or @.ABM = 0) then engine reworks my query to
> > something that doesn't work:) Like this:
> >
> > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > @.division OR @.Division = 0) AND (pj.BrandManagerID = @.ABM) OR
> > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > @.division OR @.Division = 0) AND (@.ABM = 0)
> >
> > Any help is greatly appreciated! I am working on just creating a stored
> > procedure to do all this work, but it sure would be good to know if there is
> > a way to do it with out a stored procedure. Thanks in advance.
> > Eddie
> >
> >
> > "David Bienstock" wrote:
> >
> > > try using "(pj.InitiationDate between @.StartDate AND (@.EndDate + 1))" instead
> > > of the => and <= expression
> > > --
> > > "Everyone knows something you don't know"
> > >
> > >
> > > "Eddie J" wrote:
> > >
> > > > Bruce, Antoon,
> > > > Thank you so much for you help, this seems to be a great start, but I'm
> > > > still running into some issues. Here is the way it looks with 3 parameters
> > > > w/ 1 dropdown:
> > > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
> > > > but as soon as I add another dropdown to the where clause like:
> > > > And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
> > > > the dataview automatically changes the where clause to look like this:
> > > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
> > > > (pj.BrandManagerID = @.ABM)
> > > > OR
> > > > (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
> > > > AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
> > > > Which would never give me the results I'm look for. Any ideas? Thanks
> > > > again, I'm in learning mode with reporting services.
> > > >
> > > >
> > > > "Bruce L-C [MVP]" wrote:
> > > >
> > > > > I too use this technique. It does not have to be -1, what it should be to
> > > > > prevent confusion is a value that does not exist in your data. If it is a
> > > > > text field I use the word All instead of -1. Here is the key point, you
> > > > > have an or. The first part of the or statement is looking for a specific
> > > > > value, the next is seeing if the parameter = this particular value
> > > > >
> > > > > (table1.xxx = :parameter1 or :parameter1 = -1)
> > > > >
> > > > > Note the different position the parameter is put (whether it is to the left
> > > > > or right of the equal size).
> > > > >
> > > > > Give it a try, it works great.
> > > > >
> > > > > --
> > > > > Bruce Loehle-Conger
> > > > > MVP SQL Server Reporting Services
> > > > >
> > > > > "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> > > > > news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > > > > > Thanks for your response, but in oracle does -1 return everything for that
> > > > > > column? I need All to actually return all? It looks like to me that -1
> > > > > > would just return what ever text is associated to the value -1. Thanks
> > > > > > again, I appreciate your help.
> > > > > >
> > > > > > "Antoon" wrote:
> > > > > >
> > > > > >> I'm not sure I understand completely. But here's what I do.
> > > > > >> (I use oracle, hope you can translate)
> > > > > >>
> > > > > >> I always add a "All" to my parameters list (suppose the parameter name is
> > > > > >> parameter1):
> > > > > >> Select value, label from parameters
> > > > > >> union
> > > > > >> Select -1, 'All' from dual
> > > > > >>
> > > > > >> In the data-queries I than write:
> > > > > >> Select ...
> > > > > >> from table1
> > > > > >> where
> > > > > >> (table1.xxx = :parameter1 or :parameter1 = -1)
> > > > > >>
> > > > > >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> > > > > >> think)
> > > > > >>
> > > > > >> "Eddie J" wrote:
> > > > > >>
> > > > > >> > So I have created 6 or 7 drop down lists using seperate datasets for
> > > > > >> > each
> > > > > >> > drop down and the value field is an integer value and the label field
> > > > > >> > is a
> > > > > >> > text value. The dropdowns all are set to have a datatype of integer
> > > > > >> > and
> > > > > >> > allow null value is checked. I also have default value on all of the
> > > > > >> > drop
> > > > > >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> > > > > >> > them to
> > > > > >> > the where clause in the data view screen? As soon as I add them to the
> > > > > >> > where
> > > > > >> > clause and ALL (0) is selected there is no way for me to select all
> > > > > >> > values
> > > > > >> > back. I don't want all the fields to be manditory, that's why I added
> > > > > >> > the
> > > > > >> > ALL(0) option. I know I could probably write a stored procedure to do
> > > > > >> > this,
> > > > > >> > but I was wondering if anyone else has found a way around the issue.
> > > > > >> > Thanks,
> > > > > >> > all help is greatly appreciated
> > > > >
> > > > >
> > > > >|||In the querie pannel there is an icon (two windows and a pencil), select it.
It will give you a plain text window to write your query and VS will not
interfere
"Eddie J" wrote:
> David, I did try it but received the same results. Thanks for you help!
> "David Bienstock" wrote:
> > I know what you're saying but I think if you try
> > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > @.division OR @.Division = 0) it may not re-work it
> >
> > "Eddie J" wrote:
> >
> > > David thanks for you help, but unfortunately it doesn't help? I believe the
> > > engine in the background of the Dataview is re-working my sql query for some
> > > reason. So this works fine (perfect):
> > > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > > @.division OR @.Division = 0)
> > > but as soon as I add this to the where clause
> > > and (pj.BrandManagerID = @.ABM or @.ABM = 0) then engine reworks my query to
> > > something that doesn't work:) Like this:
> > >
> > > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > > @.division OR @.Division = 0) AND (pj.BrandManagerID = @.ABM) OR
> > > (pj.InitiationDate BETWEEN @.StartDate AND @.EndDate + 1) AND (p.Division => > > @.division OR @.Division = 0) AND (@.ABM = 0)
> > >
> > > Any help is greatly appreciated! I am working on just creating a stored
> > > procedure to do all this work, but it sure would be good to know if there is
> > > a way to do it with out a stored procedure. Thanks in advance.
> > > Eddie
> > >
> > >
> > > "David Bienstock" wrote:
> > >
> > > > try using "(pj.InitiationDate between @.StartDate AND (@.EndDate + 1))" instead
> > > > of the => and <= expression
> > > > --
> > > > "Everyone knows something you don't know"
> > > >
> > > >
> > > > "Eddie J" wrote:
> > > >
> > > > > Bruce, Antoon,
> > > > > Thank you so much for you help, this seems to be a great start, but I'm
> > > > > still running into some issues. Here is the way it looks with 3 parameters
> > > > > w/ 1 dropdown:
> > > > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0)
> > > > > but as soon as I add another dropdown to the where clause like:
> > > > > And (pj.BrandManagerID = @.ABM OR @.ABM = 0)
> > > > > the dataview automatically changes the where clause to look like this:
> > > > > WHERE (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <=> > > > > @.EndDate + 1) AND (p.Division = @.division OR @.Division = 0) AND
> > > > > (pj.BrandManagerID = @.ABM)
> > > > > OR
> > > > > (pj.InitiationDate >= @.StartDate) AND (pj.InitiationDate <= @.EndDate + 1)
> > > > > AND (p.Division = @.division OR @.Division = 0) AND (@.ABM = 0)
> > > > > Which would never give me the results I'm look for. Any ideas? Thanks
> > > > > again, I'm in learning mode with reporting services.
> > > > >
> > > > >
> > > > > "Bruce L-C [MVP]" wrote:
> > > > >
> > > > > > I too use this technique. It does not have to be -1, what it should be to
> > > > > > prevent confusion is a value that does not exist in your data. If it is a
> > > > > > text field I use the word All instead of -1. Here is the key point, you
> > > > > > have an or. The first part of the or statement is looking for a specific
> > > > > > value, the next is seeing if the parameter = this particular value
> > > > > >
> > > > > > (table1.xxx = :parameter1 or :parameter1 = -1)
> > > > > >
> > > > > > Note the different position the parameter is put (whether it is to the left
> > > > > > or right of the equal size).
> > > > > >
> > > > > > Give it a try, it works great.
> > > > > >
> > > > > > --
> > > > > > Bruce Loehle-Conger
> > > > > > MVP SQL Server Reporting Services
> > > > > >
> > > > > > "Eddie J" <EddieJ@.discussions.microsoft.com> wrote in message
> > > > > > news:9DE8649E-B19F-4087-B90B-B0649FD2F13A@.microsoft.com...
> > > > > > > Thanks for your response, but in oracle does -1 return everything for that
> > > > > > > column? I need All to actually return all? It looks like to me that -1
> > > > > > > would just return what ever text is associated to the value -1. Thanks
> > > > > > > again, I appreciate your help.
> > > > > > >
> > > > > > > "Antoon" wrote:
> > > > > > >
> > > > > > >> I'm not sure I understand completely. But here's what I do.
> > > > > > >> (I use oracle, hope you can translate)
> > > > > > >>
> > > > > > >> I always add a "All" to my parameters list (suppose the parameter name is
> > > > > > >> parameter1):
> > > > > > >> Select value, label from parameters
> > > > > > >> union
> > > > > > >> Select -1, 'All' from dual
> > > > > > >>
> > > > > > >> In the data-queries I than write:
> > > > > > >> Select ...
> > > > > > >> from table1
> > > > > > >> where
> > > > > > >> (table1.xxx = :parameter1 or :parameter1 = -1)
> > > > > > >>
> > > > > > >> (oracle uses ":" to denote a parameter, in SQLServer that is a "?" I
> > > > > > >> think)
> > > > > > >>
> > > > > > >> "Eddie J" wrote:
> > > > > > >>
> > > > > > >> > So I have created 6 or 7 drop down lists using seperate datasets for
> > > > > > >> > each
> > > > > > >> > drop down and the value field is an integer value and the label field
> > > > > > >> > is a
> > > > > > >> > text value. The dropdowns all are set to have a datatype of integer
> > > > > > >> > and
> > > > > > >> > allow null value is checked. I also have default value on all of the
> > > > > > >> > drop
> > > > > > >> > downs set to 0 which is the ALL value. Now the issue, how can I add
> > > > > > >> > them to
> > > > > > >> > the where clause in the data view screen? As soon as I add them to the
> > > > > > >> > where
> > > > > > >> > clause and ALL (0) is selected there is no way for me to select all
> > > > > > >> > values
> > > > > > >> > back. I don't want all the fields to be manditory, that's why I added
> > > > > > >> > the
> > > > > > >> > ALL(0) option. I know I could probably write a stored procedure to do
> > > > > > >> > this,
> > > > > > >> > but I was wondering if anyone else has found a way around the issue.
> > > > > > >> > Thanks,
> > > > > > >> > all help is greatly appreciated
> > > > > >
> > > > > >
> > > > > >

Parameters opening the same datasets over and over again..

Hello:
I have a report with multiple tables, one table per page. On the page header
I need to show some information that is coming from a dataset, several
records like first name, last name, file#, etc..
I've a single dataset in my report, which has the data for all the tables,
and it includes the information I need in the header.
My page header expression is the sum of the values of some parameters that
gets their values from the dataset.
The problem is that the stored procedure I'm using to get the data is
executed once for each parameter, instead of executing it only once and get
the values for all the parameters locally.
Is there any way to improve this behavior?
Thanks,
Daniel Bello Urizarri.On Mar 26, 4:09 pm, "Daniel Bello" <dburiza...@.yahoo.es> wrote:
> Hello:
> I have a report with multiple tables, one table per page. On the page header
> I need to show some information that is coming from a dataset, several
> records like first name, last name, file#, etc..
> I've a single dataset in my report, which has the data for all the tables,
> and it includes the information I need in the header.
> My page header expression is the sum of the values of some parameters that
> gets their values from the dataset.
> The problem is that the stored procedure I'm using to get the data is
> executed once for each parameter, instead of executing it only once and get
> the values for all the parameters locally.
> Is there any way to improve this behavior?
> Thanks,
> Daniel Bello Urizarri.
You might be able to avoid the multiple parameters, if I understand
you correctly, by using aggregates to reference values in the dataset.
Something like this might help.
=Max(Fields!FirstName.Value, "DataSetName")
=Max(Fields!LastName.Value, "DataSetName")
=Max(Fields!FileNum.Value, "DataSetName")
Regards,
Enrique Martinez
Sr. Software Consultant|||"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1174959834.202639.33660@.p77g2000hsh.googlegroups.com...
> On Mar 26, 4:09 pm, "Daniel Bello" <dburiza...@.yahoo.es> wrote:
>> Hello:
>> I have a report with multiple tables, one table per page. On the page
>> header
>> I need to show some information that is coming from a dataset, several
>> records like first name, last name, file#, etc..
>> I've a single dataset in my report, which has the data for all the
>> tables,
>> and it includes the information I need in the header.
>> My page header expression is the sum of the values of some parameters
>> that
>> gets their values from the dataset.
>> The problem is that the stored procedure I'm using to get the data is
>> executed once for each parameter, instead of executing it only once and
>> get
>> the values for all the parameters locally.
>> Is there any way to improve this behavior?
>> Thanks,
>> Daniel Bello Urizarri.
>
> You might be able to avoid the multiple parameters, if I understand
> you correctly, by using aggregates to reference values in the dataset.
> Something like this might help.
> =Max(Fields!FirstName.Value, "DataSetName")
> =Max(Fields!LastName.Value, "DataSetName")
> =Max(Fields!FileNum.Value, "DataSetName")
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>
Enrique:
You can not use fields on the headers, that is why I'm using the parameters.
This part of the reporting services is so poorly coded, I can't see a single
reason to open the datasets several times, and I see a lot of reasons to
open the dataset only once and then use it for all the parameters, the lists
of available values and the default values.
Thanks,
Daniel Bello Urizarri.

Wednesday, March 7, 2012

Parameters for Multiple Datasets

I have two datasets. #1 supplies data for table1 and #2 supplies data for table2. They use the same parameters (@.profile_id and @.sort). The first table displays data just fine but the second table never seems to get the parameters and displays nothing. How can I pass these two parameters to the second dataset?

are you sending the same parameters to the 2 datasets

|||

Yes, I am. I discovered late last night that the XML in the RDL file was a little messed up (in the parameters area). After I set the parameters by hand, the report began to behave as I wanted it to.