Thursday, March 29, 2012
case statement with an sql query statement
a case statement in VB is ment for a string or numeric expression. if i place a sql parameter query statement it shows type mismatch. what do i do??
can you show the statement you are trying to execute? Or a better understanding of what you are after?|||ok here's the issue
i have the following: -
1. a access table: telephone_directory (fields are first name, last name, extension_no, building_name)
2. a form with menu find and sub menus "by extension number", "by first name", "by last name". ALSO another form named PF with a text box and a listbox
3. a sql parameter query as: -
cq.SQL = "PARAMETERS something1 INTEGER; SELECT * FROM TELEPHONE_DIRECTORY" & _
" WHERE LEFT(EXTENSION_NO,1) LIKE [something1] " & _
" OR LEFT(EXTENSION_NO,2) LIKE [something1] " & _
" OR LEFT(EXTENSION_NO,3) LIKE [something1] " & _
" OR LEFT(EXTENSION_NO,4) LIKE [something1] " & _
" OR LEFT(EXTENSION_NO,5) LIKE [something1] " & _
" OR LEFT(EXTENSION_NO,6) LIKE [something1] " & _
" OR EXTENSION_NO LIKE [something1] " & _
" ORDER BY EXTENSION_No; "
4. a bas file with the parameter query wherein case 1 is for extension number case 2 is for last names wherein the sql query is : -
cq.SQL = "PARAMETERS something1 text; SELECT * FROM TELEPHONE_DIRECTORY" & _
" WHERE LEFT(LAST_NAME,1)LIKE [something1] " & _
" OR LEFT(LAST_NAME,2)LIKE [something1] " & _
" OR LEFT(LAST_NAME,3)LIKE [something1] " & _
" OR LEFT(LAST_NAME,4)LIKE [something1] " & _
" OR LEFT(LAST_NAME,5)LIKE [something1] " & _
" OR LEFT(LAST_NAME,6)LIKE [something1] " & _
" OR LAST_NAME LIKE [something1] " & _
" ORDER BY LAST_NAME; "
.... and so on
5. now how do i call for the "case" in the PF form so that the text box takes the input and listbox displays result for all types of find. I am succesful with different forms for each FIND but i want to use ONLY ONE form.|||Since it's an Access database I don't know if IIf() or Switch() would help at all.sql
Thursday, March 22, 2012
Case order by
I was wondering if you guys could help me, I have a table with Firstname and
Lastname columns.
And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can sort
Firstname ASC/DESC or Lastname ASC/DESC....
how's that done, i need to put 4 different Cases?
TIA
/LasseWhat about that
Use northwind
DECLARE @.col varchar(200)
DECLARE @.Direc varchar(200)
SET @.col = 'OrderID'
SET @.Direc = 'ASC'
EXEC('Select * from Orders Order by ' + @.col + ' ' + @.Direc)
http://www.sommarskog.se/dynamic_sql.html
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Lasse Edsvik" <lasse@.nospam.com> schrieb im Newsbeitrag
news:OKlIIzxSFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Hello
> I was wondering if you guys could help me, I have a table with Firstname
> and
> Lastname columns.
> And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can
> sort
> Firstname ASC/DESC or Lastname ASC/DESC....
> how's that done, i need to put 4 different Cases?
> TIA
> /Lasse
>|||SELECT <column list>
FROM <table>
ORDER BY CASE @.AscDesc WHEN 'ASC' THEN
CASE @.SortCol
WHEN 'Firstname' THEN Firstname
WHEN 'Lastname' THEN Lastname
END END ASC,
CASE @.AscDesc WHEN 'DESC' THEN
CASE @.SortCol
WHEN 'Firstname' THEN Firstname
WHEN 'Lastname' THEN Lastname
END END DESC,
Jacco Schalkwijk
SQL Server MVP
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:OKlIIzxSFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Hello
> I was wondering if you guys could help me, I have a table with Firstname
> and
> Lastname columns.
> And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can
> sort
> Firstname ASC/DESC or Lastname ASC/DESC....
> how's that done, i need to put 4 different Cases?
> TIA
> /Lasse
>|||Lasse
ORDER BY CASE WHEN @.sort = 'col1' AND @.dir = 1 THEN col1 END ASC,
CASE WHEN @.sort = 'col1' AND @.dir = 0 THEN col1 END DESC,
CASE WHEN @.sort = 'col2' AND @.dir = 1 THEN col2 END ASC,
CASE WHEN @.sort = 'col2' AND @.dir = 0 THEN col2 END DESC
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:OKlIIzxSFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Hello
> I was wondering if you guys could help me, I have a table with Firstname
and
> Lastname columns.
> And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can
sort
> Firstname ASC/DESC or Lastname ASC/DESC....
> how's that done, i need to put 4 different Cases?
> TIA
> /Lasse
>|||How do I use a variable in an ORDER BY clause?
http://www.aspfaq.com/show.asp?id=2501
AMB
"Lasse Edsvik" wrote:
> Hello
> I was wondering if you guys could help me, I have a table with Firstname a
nd
> Lastname columns.
> And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can so
rt
> Firstname ASC/DESC or Lastname ASC/DESC....
> how's that done, i need to put 4 different Cases?
> TIA
> /Lasse
>
>|||The below uses one input variable to control which column to sort by, and
whether to cort asc or desc...
Use NorthWind
Declare @.Order TinyInt
Set @.Order = 1 -- 2,3,4
-- --
Select * From Customers
Order By Case @.Order
When 1 Then CompanyName
When 3 Then ContactName
End,
Case @.Order
When 2 Then CompanyName
When 4 Then ContactName
End Desc
"Lasse Edsvik" wrote:
> Hello
> I was wondering if you guys could help me, I have a table with Firstname a
nd
> Lastname columns.
> And I want to pass a parameter @.SortCol char(10) and @.AscDesc, so I can so
rt
> Firstname ASC/DESC or Lastname ASC/DESC....
> how's that done, i need to put 4 different Cases?
> TIA
> /Lasse
>
>sql
case join statement
If @.cona=1 then
............
from lokStanje l INNER JOIN
(objSta Sc INNER JOIN artCona Ac ON Sc.ART_SIF=Ac.ART_SIF AND
Sc.STA_OZN=@.STA_OZN INNER JOIN LOKCONA Lc ON Ac.CONA=Lc.CONA)
ON l.LOK_OZN=Lc.LOK_OZN
LEFT JOIN .............
If @.cona=0 then--I don't need INNER JOIN:
............
from lokStanje l
LEFT JOIN .............
I don't won't to write 2 queries, one for @.cona=0 and one for @.cona=1
because query is quite large.
I would like to know if it's possible to somehow combine @.cona in my query,
something like:
............
from lokStanje l case when @.cona=1 then INNER JOIN
(objSta Sc INNER JOIN artCona Ac ON Sc.ART_SIF=Ac.ART_SIF AND
Sc.STA_OZN=@.STA_OZN INNER JOIN LOKCONA Lc ON Ac.CONA=Lc.CONA)
ON l.LOK_OZN=Lc.LOK_OZN end
LEFT JOIN .............
Thank you for your answer,
SimonWith the least code possible:
............
from lokStanje l INNER JOIN
(objSta Sc INNER JOIN artCona Ac ON Sc.ART_SIF=Ac.ART_SIF AND
Sc.STA_OZN=@.STA_OZN INNER JOIN LOKCONA Lc ON Ac.CONA=Lc.CONA)
ON l.LOK_OZN=Lc.LOK_OZN
OR @.cona=0
LEFT JOIN .............
However, this might not result in the optimal query plan. If you are coding
to get the best performance, having two separate statements (maybe even in 2
separate stored procedures) is the better solution, as the best query plan
will be used in every case.
Jacco Schalkwijk
SQL Server MVP
"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:uTzxdOCPFHA.3336@.TK2MSFTNGP09.phx.gbl...
>I have parameter @.cona.
> If @.cona=1 then
> ............
> from lokStanje l INNER JOIN
> (objSta Sc INNER JOIN artCona Ac ON Sc.ART_SIF=Ac.ART_SIF AND
> Sc.STA_OZN=@.STA_OZN INNER JOIN LOKCONA Lc ON Ac.CONA=Lc.CONA)
> ON l.LOK_OZN=Lc.LOK_OZN
> LEFT JOIN .............
>
> If @.cona=0 then--I don't need INNER JOIN:
> ............
> from lokStanje l
> LEFT JOIN .............
> I don't won't to write 2 queries, one for @.cona=0 and one for @.cona=1
> because query is quite large.
> I would like to know if it's possible to somehow combine @.cona in my
> query, something like:
> ............
> from lokStanje l case when @.cona=1 then INNER JOIN
> (objSta Sc INNER JOIN artCona Ac ON Sc.ART_SIF=Ac.ART_SIF AND
> Sc.STA_OZN=@.STA_OZN INNER JOIN LOKCONA Lc ON Ac.CONA=Lc.CONA)
> ON l.LOK_OZN=Lc.LOK_OZN end
> LEFT JOIN .............
> Thank you for your answer,
> Simon
>
Monday, March 19, 2012
Cascading(?) Parameters Help
I have 2 parameters that are of type string. The user can enter anything they want in them. The third parameter is query based and uses the first 2 parameters to get a list of people. Is there a way I can prevent the third parameter from propigating until the first 2 are both filled in? The first 2 cannot be drop downs however, they are used in a wild card fashion.
Thanks!
Yes. Set the default on the text boxes to NULL.
Then it shouldnt try to populate until both are not null.
I just created a test report and it did not populate until both names were entered.
BobP
|||In RS2005? I just did the same thing, and the 3rd Parameter became available after I entered something in the 1st parameter (no values because the query is where firstname = @.param1 and lastname = @.param2). However, the real query is using firstname LIKE @.param1 and lastname LIKE param2 and thus populates the list as soon as I enter the first name. Which is confusing because param2 is empty. Any ideas?
|||Ah.. I see. I had the 'Allow blank value' selected. However, not pretty, it works.
|||So it IS working for you, right?
BobP
|||Yes.. thanks.Cascading parameters.
Use the StrToMember method. Using AdventureWorks, if you wanted to limit the list of Product Subcategories from the selected category, @.Category.
Code Snippet
WITH MEMBER [Measures].[ParameterLabel] AS
[Product].[Subcategory].CurrentMember.MEMBER_CAPTION
MEMBER [Measures].[ParameterValue] AS
[Product].[Subcategory].CurrentMember.UniqueName
SELECT {
[Measures].[ParameterLabel],
[Measures].[ParameterValue]
} ON COLUMNS,
NON EMPTY
{ [Product].[Subcategory].[Subcategory].Members }
ON ROWS
FROM [Adventure Works]
WHERE (
StrToMember(@.Category, CONSTRAINED)
)
Cascading Parameters ValidValues via the Webservices?
know a way to get validvalues of a parameter that is dependent on a chosen
value of another param? Thanks.If the valid values query for the second parameter (B) references the value of the first parameter
(A), the valid values list of B should dynamically change based on A.
--
Thanks.
Donovan R. Smith
Software Test Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
"Steve Landis" <landiss@.bus.oregonstate.edu> wrote in message
news:um8bvJUWEHA.3472@.TK2MSFTNGP09.phx.gbl...
> I'd like to access validvalues in a report through the webservices. Anyone
> know a way to get validvalues of a parameter that is dependent on a chosen
> value of another param? Thanks.
>|||Can I do this via the webservices? I'm still not clear on how to do it.
The query for the second parameter (B) is parameterized using the first
parameter (A) and works fine using the report manager to render the report.
However, if I do
ReportParameter[] parameters = rs.GetReportParameters(myReportPath, null,
false, null, null);
then parameters[0] will have valid values, but parameters[1] won't yet.
This makes sense, because it doesn't have a value from the first parameter
to query with. Is there a way for me to now send a value picked out of the
first parameter's valid values back to the server and get the valid values
for the second parameter? I've tried recalling GetReportParameters with a
ParameterValue[], but that doesn't seem to work.
Thanks.
"Donovan R. Smith [MSFT]" <donovans@.online.microsoft.com> wrote in message
news:OqkzusUWEHA.1888@.TK2MSFTNGP11.phx.gbl...
> If the valid values query for the second parameter (B) references the
value of the first parameter
> (A), the valid values list of B should dynamically change based on A.
> --
> Thanks.
> Donovan R. Smith
> Software Test Lead
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Steve Landis" <landiss@.bus.oregonstate.edu> wrote in message
> news:um8bvJUWEHA.3472@.TK2MSFTNGP09.phx.gbl...
> > I'd like to access validvalues in a report through the webservices.
Anyone
> > know a way to get validvalues of a parameter that is dependent on a
chosen
> > value of another param? Thanks.
> >
> >
>|||Hi Steve:
I have an example here: http://odetocode.com/Articles/123.aspx
HTH,
--
Scott
http://www.OdeToCode.com
On Wed, 23 Jun 2004 09:52:12 -0700, "Steve Landis"
<landiss@.bus.oregonstate.edu> wrote:
>I'd like to access validvalues in a report through the webservices. Anyone
>know a way to get validvalues of a parameter that is dependent on a chosen
>value of another param? Thanks.
>|||Thanks!
"Scott Allen" <bitmask@.[nospam].fred.net> wrote in message
news:p3njd0t8smjh6kun5dnu1vocpu7qe24vui@.4ax.com...
> Hi Steve:
> I have an example here: http://odetocode.com/Articles/123.aspx
> HTH,
> --
> Scott
> http://www.OdeToCode.com
> On Wed, 23 Jun 2004 09:52:12 -0700, "Steve Landis"
> <landiss@.bus.oregonstate.edu> wrote:
> >I'd like to access validvalues in a report through the webservices.
Anyone
> >know a way to get validvalues of a parameter that is dependent on a
chosen
> >value of another param? Thanks.
> >
>
Cascading parameters problem : First parameter is textbox
I am using cascading parameters in my report. The first paramter is a
servername which user types in a TextBox. The second parameter is
populated based on the first parameter.
The problem is secord paramter drop down list doesn't get populated
unless I press "View Report" button in the preview mode.
Is there any way to populate second parameter (drop downlist) as user
finished typing the first parameter (TextBox)
please help,
regards,
SAchinUser needs to press "Tab" key to populate and need not press "view report"
Amarnath
"sachin laddha" wrote:
> Hi,
> I am using cascading parameters in my report. The first paramter is a
> servername which user types in a TextBox. The second parameter is
> populated based on the first parameter.
> The problem is secord paramter drop down list doesn't get populated
> unless I press "View Report" button in the preview mode.
> Is there any way to populate second parameter (drop downlist) as user
> finished typing the first parameter (TextBox)
> please help,
> regards,
> SAchin
>
Cascading Parameters problem
Ex:
First I would like to fill the parameter fields (text fields):
From Date - To Date,
From Customer - To Customer
then the process begins to filter the rest of the fields values.
ChristoferYou could put the fields that you want filtered by the Date and Customer into a subreport then filter the subreport by the value in the Date and Customer fields.
Cascading Parameters problem
I am using two parameters in my report. DepartmentID and EmployeeID. The employeeID is cascaded and it expects a DepartmentID as the query parameter in stored proc. The sp works fine in SQL and even from the datasets created in report designer. But when I preview the report and select a department to get the employee list populated, I get the following weirdo error:
An error occured during local report processing
The value provided for the report parameter 'EmployeeID' is not valid for its type.
I have checked and rechecked, and had some one else take a look at the report params, data types, and stored procs, but for the life of it, I can't figure out why I am getting this error? It seems the report designer is goofed up or something. Any ideas?
Never mind,, I resolved it. Somehow the allow blank values was highlighted even though the parameter data type was selected as integer.Cascading Parameters problem
I am using two parameters in my report. DepartmentID and EmployeeID. The employeeID is cascaded and it expects a DepartmentID as the query parameter in stored proc. The sp works fine in SQL and even from the datasets created in report designer. But when I preview the report and select a department to get the employee list populated, I get the following weirdo error:
An error occured during local report processing
The value provided for the report parameter 'EmployeeID' is not valid for its type.
I have checked and rechecked, and had some one else take a look at the report params, data types, and stored procs, but for the life of it, I can't figure out why I am getting this error? It seems the report designer is goofed up or something. Any ideas?
Never mind,, I resolved it. Somehow the allow blank values was highlighted even though the parameter data type was selected as integer.cascading parameters in Webpart
In a Webpart, I have a report with 2 parameters.. the second parameter is
dependent on the first parameter.. I have noticed that when I changed the
first parameter, the values of the second parameter doesn't changed.., so I
got an error..
Can anybody help me?Do you get the same behavior when not in the webpart?
--
| Thread-Topic: cascading parameters in Webpart
| thread-index: AcWCyilGfXMDE2rkQn6X17V43/TYaw==| X-WBNR-Posting-Host: 195.6.59.36
| From: "=?Utf-8?B?cjM4ODA0Mg==?=" <r388042@.discussions.microsoft.com>
| Subject: cascading parameters in Webpart
| Date: Thu, 7 Jul 2005 01:02:03 -0700
| Lines: 7
| Message-ID: <9C86DC82-335A-4E95-93FB-4D3DE94B72A4@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:47555
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi,
| In a Webpart, I have a report with 2 parameters.. the second parameter is
| dependent on the first parameter.. I have noticed that when I changed the
| first parameter, the values of the second parameter doesn't changed.., so
I
| got an error..
| Can anybody help me?
|
||||No. The application runs correctly in Visual Studio.net or in the reporting
services server.
I thinks that the problem is due to the parameters or a property of the
Webpart. But I don't know exactly.
""Brad Syputa - MS"" wrote:
> Do you get the same behavior when not in the webpart?
> --
> | Thread-Topic: cascading parameters in Webpart
> | thread-index: AcWCyilGfXMDE2rkQn6X17V43/TYaw==> | X-WBNR-Posting-Host: 195.6.59.36
> | From: "=?Utf-8?B?cjM4ODA0Mg==?=" <r388042@.discussions.microsoft.com>
> | Subject: cascading parameters in Webpart
> | Date: Thu, 7 Jul 2005 01:02:03 -0700
> | Lines: 7
> | Message-ID: <9C86DC82-335A-4E95-93FB-4D3DE94B72A4@.microsoft.com>
> | MIME-Version: 1.0
> | Content-Type: text/plain;
> | charset="Utf-8"
> | Content-Transfer-Encoding: 7bit
> | X-Newsreader: Microsoft CDO for Windows 2000
> | Content-Class: urn:content-classes:message
> | Importance: normal
> | Priority: normal
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:47555
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | Hi,
> | In a Webpart, I have a report with 2 parameters.. the second parameter is
> | dependent on the first parameter.. I have noticed that when I changed the
> | first parameter, the values of the second parameter doesn't changed.., so
> I
> | got an error..
> | Can anybody help me?
> |
> |
>
Cascading Parameters in Dev environment Convulsing
down list. When you change the first drop down, the dev environment goes
into convulsions and starts flashing. I've done some research and found this
issue in a few places on the net but have not found a solution. All
indications ar ethat it will work fine once deployed. Anyone know of the
solution to this issue or a work around?I don't have this happen with all cascading parameter reports, just some of
them. I don't have a pattern for when it happens and when it doesn't. For
those reports where this happens I test by deploying to a test server rather
than testing from the dev environment. As you say, they work when deployed.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Stephen Farmer" <Stephen.Farmer@.LucrumInc.Com> wrote in message
news:eADozujWFHA.2448@.TK2MSFTNGP12.phx.gbl...
> I'm usring RS SP2 and have a cascading parameter. Both parameters are drop
> down list. When you change the first drop down, the dev environment goes
> into convulsions and starts flashing. I've done some research and found
> this issue in a few places on the net but have not found a solution. All
> indications ar ethat it will work fine once deployed. Anyone know of the
> solution to this issue or a work around?
>
>
cascading parameters in a Webpart
the second parameter is dependent on the first parameter..
I have noticed that when I changed the first parameter, the values of the second parameter doesn't changed.., so I got an error..
Can you help me?Hi,
I am having the exact same problem. It seems that the default values set initially in the report aren't being carried over to all of the parameters in the web parts.
I have not been able to find a solution yet. Please let me know if you have an answer.
Thanks!|||Hi
I got something similar did you get an answer?
Cascading parameters and multi-value parameters
well. (basically a parameter with yard and well as values, but I made
it a multi-value parameter so they can choose both if needed). The
problem I am having is that the next paramater is based off of the
first one. If yard is selected I run a certain query, if well is
selected a run a different query. How can I say if all is selected
join both the yard and well query to get the data results. Any ideas?
thanks in advance.Use an If in the datatab and use In ('Yard', 'Well') in your query.
Amarnath
"aggiechick717" wrote:
> I have a dataset where a user can select yard, well, or both yard and
> well. (basically a parameter with yard and well as values, but I made
> it a multi-value parameter so they can choose both if needed). The
> problem I am having is that the next paramater is based off of the
> first one. If yard is selected I run a certain query, if well is
> selected a run a different query. How can I say if all is selected
> join both the yard and well query to get the data results. Any ideas?
> thanks in advance.
>
Sunday, March 11, 2012
Cascading Parameters
York) open another hidden Parameter LIST (City ,List of 4 to select from)
for another selection before viewing the report.
Anyway to do this easily in Report services !
Signed
AEM
--
Auggie - Central - USAYou can easily have cascading parameters but you cannot hide/show parameter
lists.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Auggie USA" <AuggieUSA@.discussions.microsoft.com> wrote in message
news:0C789E92-BF75-4D05-ABAC-2F9BD9D26C61@.microsoft.com...
> IN SQL RS 2005, Trying to have a paramater upon item selection ( say New
> York) open another hidden Parameter LIST (City ,List of 4 to select from)
> for another selection before viewing the report.
> Anyway to do this easily in Report services !
> Signed
> AEM
>
>
> --
> Auggie - Central - USA
>|||That what I thought !
Thanks for the Answer !
--
Auggie - Central - USA
"Bruce L-C [MVP]" wrote:
> You can easily have cascading parameters but you cannot hide/show parameter
> lists.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Auggie USA" <AuggieUSA@.discussions.microsoft.com> wrote in message
> news:0C789E92-BF75-4D05-ABAC-2F9BD9D26C61@.microsoft.com...
> > IN SQL RS 2005, Trying to have a paramater upon item selection ( say New
> > York) open another hidden Parameter LIST (City ,List of 4 to select from)
> > for another selection before viewing the report.
> >
> > Anyway to do this easily in Report services !
> >
> > Signed
> >
> > AEM
> >
> >
> >
> >
> >
> > --
> > Auggie - Central - USA
> >
>
>
cascading parameters
child parameter must reflect the changes â?¦ means it should set â'Select Allâ'
automatically as default.
--
asharmaUse query and dont hard code then a post back happens everytime.
Amarnath,MCTS
"asharma2004" wrote:
> In cascading parameters if we change the value of parent parameter then the
> child parameter must reflect the changes â?¦ means it should set â'Select Allâ'
> automatically as default.
> --
> asharma|||Hi! Actually it is a 3-level dependency. Here it is..
Param_head => Country = Select country from country [single valued param]
Param1=> Region =Select region from region where country in (@.country) [Multi]
Param2=> City= Select city from cities where region in (@.region)
Let's say I selected USA for Country. For this case, Region should display
all the states in USA and City should display all the Cities in USA in
default. However, when I select just one State (i.e California), default
values on City are correct and all selected, but when I try to add another
state, i.e Utah, City displays all the cities in Utah and California but only
California cities are selected.
I could not get around this. Is this a bug or something?
Thanks!
--jarm
"Wei Lu [MSFT]" wrote:
> Hello Jarm,
> Could you please let me know the query you use for those 2 parameters?
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hello Jarm,
Yes, I reproduce this issue.
This is because after you change the first parameter, the report will not
refresh so that the default value for the second parameter will not refresh.
The only time that dependent parameters are updated is when an upstream
parameter change causes dependent parameter selections to be invalid. This
satisfies the vast majority of cases where users do not an upstream
parameter change to blow away their other settings (consider a report with
many parameters, all of which might need to be reset if the user decides to
make a change to one of the upstream values).
We'll consider doing this in a future release.
Thank you for your understanding.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.
Cascading Parameters
Hi,
I am using SQL Server 2005 reporting services. I am having a problem with Cascading Parameters. In my report there are 4 parameter . (Product Class, Product Type, Product SubType and Activites). when user open the report page he/she will have to select a value for product class depending on the selection Product Type and Sub type will be populated. So far its good, but Activities also depends on the Product Class. My question is can we have 2 parameters depend on same parameter. Here in this case Product Type and Activities both depend on the Product Class. I want only those activies in the dropdown which belongs to the Product Class that is selected.
Can anyone please give an ideas?
Thanks
Ashwini
Hi Ashwini,
I am assuming that you are using datasets or stored procedures to fill the parameters. If that is the case, This link -MIGHT- get you in the right direction.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=67984&SiteID=1
It is concerning about which dataset is being executed first, and with this, you might be able to execute certain datasets to get what you need and then based the next dataset on the previously executed dataset.
Hope this helps!
Bernard
|||Hi Bernard,
Yes I have created 4 datasets with stored procedures to fill these report parameters.
SP1 : SelectProductClassAll -->which brings in all the product class
SP2: RptSelectCascadedProductType --> which has a parameter @.selected_product_class and will bring in all the product types for the given product class.
SP3: RptSelectCascadedProductSubType --> which has a parameter @.selected_product_type and will bring in all the product sub-types for the given product types.
SP4: RptSelectCascadedProductSubType --> which has a parameter @.selected_product_class and will bring in all the Activities for the given product class.
Problem is 2nd and 4th SP expects the same parameter. After adding these datasets if you go to Report -->Report Parameters you will only have 2 parameters (which would act as a drop down filter) @.selected_product_class , @.selected_product_type and I added one for Subtypes these 3 drop downs are fine. But I am not able to get the dropdown for activites since my SP4 expects the same parameter as SP1 and I cant use the same name parameter name twice?
I hope I am clear...
I looked at the link which you send it did not give me enough information so I am still confused...
Thanks
Ashwini
|||HI Ashwini.
Actually you should be able to use the same parameter name.
Have you tried using only 3 parameters instead of 4 parameters ?
I mean, logically speaking, since two SPs are using ONE parameter, I don't see a reason why you would try and use another Report Parameter. Just make sure that the 2 stored procedures are pointing to one Parameter.
The link I posted tells of how datasets can be executed in order depending on what you need. In this case, you would want to execute SP1, before executing Sp2 and Sp3 right ?
Of course unless, I am getting it all confused myself which is not a good thing.
Bernard
|||Without reading in detail too much, I'd say yes to you can re-use same parameter (same name) for different parameters
e.g. our reports have performance venue dropdown based on the date range selected (@.start_date to @.end_date)
then performance type, based on the venue AND date range
then say seating zones of the venue, based on type AND venue AND date range
|||Ok may be I am understanding the concept of report parameter wrong...If I only have 3 parameters it will only show 3 dropdown menu when I actually run the report right? for ex: Product class, type and subtype. I need to have another dropdown menu for Activities as well how would I get this if I dont have a report parameter for it?
As per my understanding SRS will create these dropdown menus for you based on the report parameter. Please correct me if I am wrong...
|||In your case, you only have 3 params, isn't it. The #2 and #4 sp share the same parameter which is your Selected_Product_Class. So when user makes a selection for ProductClass both sp should run based on that Product Class. If you want to pass different values of Selected_Product_Class to these 2 sp, then you need to define 2 separate parameters and fill them both with your #1 sp. But in that case you will have 2 Selected_Product_Class, not sure if that's what you intend to do.|||Ashwini Ramaiah wrote:
I need to have another dropdown menu for Activities as well how would I get this if I dont have a report parameter for it?
Define another parameter and fill it with your #1 sp, just liek you did earlier. And pass the value of this param to your #4 sp. But this way, user will be able to select 2 different values of your ProductClass. If you want them to be same, then just fill this new param with the value of your already selected product class parameter.
|||Thanks Everyone!!!
Its working now....I am not sure what was the problem. All I did was delete all my parameter and datasets and re do it. I created a 4th parameter and hooked it up with Activities Data which in turn is looking fo SP4 which expects @.selected_Product_Class parameter. Trust me I did try this like 100 times it didnt work that time when I deleted the whole thing and recreated all the parameters its all good now.
I have 4 dropdowns in my Report when user comes in He/She would only be able to select a value from Product Class rest 3 will be grayed once product class is selected Product type and Activities dropdown's data gets populated and the user can select Product Sub type which is 4th dropdown. This is exactly what I wanted.
Once again thanks to everyone!!!
Ashwini
Cascading Parameters
have a query for dataset 1 based on metrics. The metric they choose needs
to be a parameter in the second dataset query I have. I have created a
parameter for the metric and have it tied to a query (in the report
parameters window) ... but if I put metric (which of course has to be a ? for
unnamed parameters) as a parameter in the second dataset then I get an error.
How does reporting services know that the metric is a parameter to the
second dataset?In the dataset click on the ... go to the parameters tab. Map the query
parameter to the parameter that the cascading parameter is based on.
In layout tab go to Report Menu -> Report Parameters. Make sure the
parameter the second dataset is dependent on is before the depenent
parameter.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MJT" <MJT@.discussions.microsoft.com> wrote in message
news:F796C0FB-6834-4D06-A875-003809DA36F9@.microsoft.com...
>I am using DB2 ... how do I tie the parameter from one dataset to another.
>I
> have a query for dataset 1 based on metrics. The metric they choose
> needs
> to be a parameter in the second dataset query I have. I have created a
> parameter for the metric and have it tied to a query (in the report
> parameters window) ... but if I put metric (which of course has to be a ?
> for
> unnamed parameters) as a parameter in the second dataset then I get an
> error.
> How does reporting services know that the metric is a parameter to the
> second dataset?|||Bruce,
I'm not sure if I was clear in my post. The first dataset does not have a
parameter but the selection from that result set needs to BE the parameter
for the second dataset
dataset 1:
select distinct metric_code, metric_name
from grsinst1.metric met
join grsinst1.availability_def availdef
on availdef.derived_metric_code = met.metric_code with ur
dataset 2:
SELECT res_name, start_lcl_dt, res_grp_name, res.res_type, value AS
Percent, value_cnt, metric_name, client_name, coalesce(thresh.threshd_target,
grpthresh.threshd_target) AS threshd_target,
coalesce(thresh.threshd_warning, grpthresh.threshd_warning) AS
threshd_warning,
coalesce(thresh.threshd_critical,
grpthresh.threshd_critical) AS threshd_critical, MAX(start_lcl_dt) OVER() AS
MaxDate,
CASE WHEN start_lcl_dt = MAX(start_lcl_dt) OVER()
THEN(((100.0 - VALUE) / 100) * VALUE_CNT) / 60 ELSE 0 END AS DTMin
FROM grsinst1.availability_monthly_vw am JOIN
grsinst1.metric met ON met.metric_code =am.metric_code JOIN
grsinst1.restree_resgrp_client_vw res ON res.res_id =am.res_id AND res.res_grp_id = am.res_grp_id LEFT JOIN
grsinst1.threshold thresh ON thresh.res_code =res.res_code AND thresh.metric_id = met.metric_id AND thresh.res_type =res.res_type JOIN
grsinst1.grp_threshold_vw grpthresh ON
grpthresh.res_grp_id = res.res_grp_id AND grpthresh.metric_id = met.metric_id
WHERE res.client_code LIKE ? AND DATE (start_lcl_dt) >= ? AND DATE
(start_lcl_dt) <= ? AND res.res_code LIKE ? AND group_path LIKE ? AND
res.res_type = ?
GROUP BY res_name, start_lcl_dt, res_grp_name, res.res_type, value,
value_cnt, metric_name, client_name, coalesce(thresh.threshd_target,
grpthresh.threshd_target),
coalesce(thresh.threshd_warning, grpthresh.threshd_warning),
coalesce(thresh.threshd_critical, grpthresh.threshd_critical)
with ur
Dataset 2 used to have metric_code in the WHERE clause - however ... I
needed to make metric code dynamic so I took it out and put it in its own
dataset. If I have in the where clause "where metric_code = ? ... and "
then I get an error saying there are too many parameters for Dataset 2. I
have metric_code (the parameter) mapped to the query for dataset 1 on the
report parameters tab. What am I missing from what you said?
"Bruce L-C [MVP]" wrote:
> In the dataset click on the ... go to the parameters tab. Map the query
> parameter to the parameter that the cascading parameter is based on.
> In layout tab go to Report Menu -> Report Parameters. Make sure the
> parameter the second dataset is dependent on is before the depenent
> parameter.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MJT" <MJT@.discussions.microsoft.com> wrote in message
> news:F796C0FB-6834-4D06-A875-003809DA36F9@.microsoft.com...
> >I am using DB2 ... how do I tie the parameter from one dataset to another.
> >I
> > have a query for dataset 1 based on metrics. The metric they choose
> > needs
> > to be a parameter in the second dataset query I have. I have created a
> > parameter for the metric and have it tied to a query (in the report
> > parameters window) ... but if I put metric (which of course has to be a ?
> > for
> > unnamed parameters) as a parameter in the second dataset then I get an
> > error.
> > How does reporting services know that the metric is a parameter to the
> > second dataset?
>
>|||Is the user supposed to pick the metric? If so, then the first dataset is
being used as the source for the first parameter. Then everything else I
said holds true. If not, then you should do remove dataset 1 and change the
second one to this:
select ... where ... metric_code in (select distinct metric_code from ...)
Note that you only want one field being returned if you are using an IN
clause.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MJT" <MJT@.discussions.microsoft.com> wrote in message
news:2254419F-D76F-4161-BA4D-FD6FFE7316B0@.microsoft.com...
> Bruce,
> I'm not sure if I was clear in my post. The first dataset does not have
> a
> parameter but the selection from that result set needs to BE the parameter
> for the second dataset
> dataset 1:
> select distinct metric_code, metric_name
> from grsinst1.metric met
> join grsinst1.availability_def availdef
> on availdef.derived_metric_code = met.metric_code with ur
> dataset 2:
> SELECT res_name, start_lcl_dt, res_grp_name, res.res_type, value AS
> Percent, value_cnt, metric_name, client_name,
> coalesce(thresh.threshd_target,
> grpthresh.threshd_target) AS threshd_target,
> coalesce(thresh.threshd_warning, grpthresh.threshd_warning) AS
> threshd_warning,
> coalesce(thresh.threshd_critical,
> grpthresh.threshd_critical) AS threshd_critical, MAX(start_lcl_dt) OVER()
> AS
> MaxDate,
> CASE WHEN start_lcl_dt = MAX(start_lcl_dt) OVER()
> THEN(((100.0 - VALUE) / 100) * VALUE_CNT) / 60 ELSE 0 END AS DTMin
> FROM grsinst1.availability_monthly_vw am JOIN
> grsinst1.metric met ON met.metric_code => am.metric_code JOIN
> grsinst1.restree_resgrp_client_vw res ON res.res_id => am.res_id AND res.res_grp_id = am.res_grp_id LEFT JOIN
> grsinst1.threshold thresh ON thresh.res_code => res.res_code AND thresh.metric_id = met.metric_id AND thresh.res_type => res.res_type JOIN
> grsinst1.grp_threshold_vw grpthresh ON
> grpthresh.res_grp_id = res.res_grp_id AND grpthresh.metric_id => met.metric_id
> WHERE res.client_code LIKE ? AND DATE (start_lcl_dt) >= ? AND DATE
> (start_lcl_dt) <= ? AND res.res_code LIKE ? AND group_path LIKE ? AND
> res.res_type = ?
> GROUP BY res_name, start_lcl_dt, res_grp_name, res.res_type, value,
> value_cnt, metric_name, client_name, coalesce(thresh.threshd_target,
> grpthresh.threshd_target),
> coalesce(thresh.threshd_warning, grpthresh.threshd_warning),
> coalesce(thresh.threshd_critical, grpthresh.threshd_critical)
> with ur
>
> Dataset 2 used to have metric_code in the WHERE clause - however ... I
> needed to make metric code dynamic so I took it out and put it in its own
> dataset. If I have in the where clause "where metric_code = ? ... and
> "
> then I get an error saying there are too many parameters for Dataset 2.
> I
> have metric_code (the parameter) mapped to the query for dataset 1 on the
> report parameters tab. What am I missing from what you said?
> "Bruce L-C [MVP]" wrote:
>> In the dataset click on the ... go to the parameters tab. Map the query
>> parameter to the parameter that the cascading parameter is based on.
>> In layout tab go to Report Menu -> Report Parameters. Make sure the
>> parameter the second dataset is dependent on is before the depenent
>> parameter.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "MJT" <MJT@.discussions.microsoft.com> wrote in message
>> news:F796C0FB-6834-4D06-A875-003809DA36F9@.microsoft.com...
>> >I am using DB2 ... how do I tie the parameter from one dataset to
>> >another.
>> >I
>> > have a query for dataset 1 based on metrics. The metric they choose
>> > needs
>> > to be a parameter in the second dataset query I have. I have created a
>> > parameter for the metric and have it tied to a query (in the report
>> > parameters window) ... but if I put metric (which of course has to be a
>> > ?
>> > for
>> > unnamed parameters) as a parameter in the second dataset then I get an
>> > error.
>> > How does reporting services know that the metric is a parameter to the
>> > second dataset?
>>|||Bruce,
I am a little confused but I believe I have it correct. Dataset 1 does
not have a parameter - it is a query that is providing the selections for a
parameter (metric_code) Dataset 2 has a query with a where clause that
includes Where metric_code like ? and I want the ? to be the selection
that was made from the choices provided from Dataset 1. In Dataset 2 - on
the parameters tab for the dataset, I have the ? representing metric_code
tied to Parameters!metric_code. On the report parameters tab, I have the
parameter metric_code tied to Dataset 1 for it's available values. So I
believe that I am running the query for Dataset 2 with whatever has been
supplied as the choice from Dataset 1. I put the parameter back in the WHERE
clause for the Dataset 2 query and I didnt get the error I was getting before
... about too many parameters for Dataset 2 ... so I hope that I have this
correct now.
"Bruce L-C [MVP]" wrote:
> Is the user supposed to pick the metric? If so, then the first dataset is
> being used as the source for the first parameter. Then everything else I
> said holds true. If not, then you should do remove dataset 1 and change the
> second one to this:
> select ... where ... metric_code in (select distinct metric_code from ...)
> Note that you only want one field being returned if you are using an IN
> clause.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MJT" <MJT@.discussions.microsoft.com> wrote in message
> news:2254419F-D76F-4161-BA4D-FD6FFE7316B0@.microsoft.com...
> > Bruce,
> > I'm not sure if I was clear in my post. The first dataset does not have
> > a
> > parameter but the selection from that result set needs to BE the parameter
> > for the second dataset
> >
> > dataset 1:
> > select distinct metric_code, metric_name
> > from grsinst1.metric met
> > join grsinst1.availability_def availdef
> > on availdef.derived_metric_code = met.metric_code with ur
> >
> > dataset 2:
> >
> > SELECT res_name, start_lcl_dt, res_grp_name, res.res_type, value AS
> > Percent, value_cnt, metric_name, client_name,
> > coalesce(thresh.threshd_target,
> > grpthresh.threshd_target) AS threshd_target,
> > coalesce(thresh.threshd_warning, grpthresh.threshd_warning) AS
> > threshd_warning,
> > coalesce(thresh.threshd_critical,
> > grpthresh.threshd_critical) AS threshd_critical, MAX(start_lcl_dt) OVER()
> > AS
> > MaxDate,
> > CASE WHEN start_lcl_dt = MAX(start_lcl_dt) OVER()
> > THEN(((100.0 - VALUE) / 100) * VALUE_CNT) / 60 ELSE 0 END AS DTMin
> > FROM grsinst1.availability_monthly_vw am JOIN
> > grsinst1.metric met ON met.metric_code => > am.metric_code JOIN
> > grsinst1.restree_resgrp_client_vw res ON res.res_id => > am.res_id AND res.res_grp_id = am.res_grp_id LEFT JOIN
> > grsinst1.threshold thresh ON thresh.res_code => > res.res_code AND thresh.metric_id = met.metric_id AND thresh.res_type => > res.res_type JOIN
> > grsinst1.grp_threshold_vw grpthresh ON
> > grpthresh.res_grp_id = res.res_grp_id AND grpthresh.metric_id => > met.metric_id
> > WHERE res.client_code LIKE ? AND DATE (start_lcl_dt) >= ? AND DATE
> > (start_lcl_dt) <= ? AND res.res_code LIKE ? AND group_path LIKE ? AND
> > res.res_type = ?
> > GROUP BY res_name, start_lcl_dt, res_grp_name, res.res_type, value,
> > value_cnt, metric_name, client_name, coalesce(thresh.threshd_target,
> > grpthresh.threshd_target),
> > coalesce(thresh.threshd_warning, grpthresh.threshd_warning),
> > coalesce(thresh.threshd_critical, grpthresh.threshd_critical)
> > with ur
> >
> >
> > Dataset 2 used to have metric_code in the WHERE clause - however ... I
> > needed to make metric code dynamic so I took it out and put it in its own
> > dataset. If I have in the where clause "where metric_code = ? ... and
> > "
> > then I get an error saying there are too many parameters for Dataset 2.
> > I
> > have metric_code (the parameter) mapped to the query for dataset 1 on the
> > report parameters tab. What am I missing from what you said?
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> In the dataset click on the ... go to the parameters tab. Map the query
> >> parameter to the parameter that the cascading parameter is based on.
> >>
> >> In layout tab go to Report Menu -> Report Parameters. Make sure the
> >> parameter the second dataset is dependent on is before the depenent
> >> parameter.
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >> "MJT" <MJT@.discussions.microsoft.com> wrote in message
> >> news:F796C0FB-6834-4D06-A875-003809DA36F9@.microsoft.com...
> >> >I am using DB2 ... how do I tie the parameter from one dataset to
> >> >another.
> >> >I
> >> > have a query for dataset 1 based on metrics. The metric they choose
> >> > needs
> >> > to be a parameter in the second dataset query I have. I have created a
> >> > parameter for the metric and have it tied to a query (in the report
> >> > parameters window) ... but if I put metric (which of course has to be a
> >> > ?
> >> > for
> >> > unnamed parameters) as a parameter in the second dataset then I get an
> >> > error.
> >> > How does reporting services know that the metric is a parameter to the
> >> > second dataset?
> >>
> >>
> >>
>
>|||I guess what confused me about what you wrote is this "make sure the
parameter the second dataset is dependent on is before the dependent
parameter" ? there is only one parameter shared between the 2 datasets and
it is the metric_code. The first dataset does not have a parameter ... it is
just a query to supply values FOR a parameter (metric_code) . The second
dataset has a parameter called metric_code which is a *value* chosen from the
first dataset. Therefore ... I have metric_code as the first parameter in
the list of parameters on the report parameter window ... that is followed by
client, start_date, end_date ... etc etc which are all parameters for the
second datatset. So if you meant to say "make sure the parameter the second
dataset is dependent on appears at the top of the parameter list" then that
makes sense. If you are implying that I somehow need 2 parameters for
metric_code then I guess I dont understand. Thanks, Bruce for helping with
this.
"Bruce L-C [MVP]" wrote:
> In the dataset click on the ... go to the parameters tab. Map the query
> parameter to the parameter that the cascading parameter is based on.
> In layout tab go to Report Menu -> Report Parameters. Make sure the
> parameter the second dataset is dependent on is before the depenent
> parameter.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MJT" <MJT@.discussions.microsoft.com> wrote in message
> news:F796C0FB-6834-4D06-A875-003809DA36F9@.microsoft.com...
> >I am using DB2 ... how do I tie the parameter from one dataset to another.
> >I
> > have a query for dataset 1 based on metrics. The metric they choose
> > needs
> > to be a parameter in the second dataset query I have. I have created a
> > parameter for the metric and have it tied to a query (in the report
> > parameters window) ... but if I put metric (which of course has to be a ?
> > for
> > unnamed parameters) as a parameter in the second dataset then I get an
> > error.
> > How does reporting services know that the metric is a parameter to the
> > second dataset?
>
>
Cascading Parameter with ODBC , visula studio 2005
I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.
In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?
I have define the two parameter and for the second parameter here is the query
="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "
To access parameter i need to use Parameters!paramOffice.Value with ODBC driver instead of @.param.
Can any one help me.
Thanks
Novin
Hi Novin,
This is something that I have done many of times. I will try and explain how to do this correctly.
1. Make a data set with your Office list
2. Make a second data set with a select statement like:
SELECT
ACCOUNT_ID,
ACCOUNT_NUMBER
FROM MLGDB2.A_ACCOUNT
WHERE OFFICE_ID in (@.Office.Value)
ORDER BY ACCOUNT_ID
3. Make sure you add a parameter to the second data set called @.Office on the parameter tab in the data set.
4. Now go to your report parameters and create two parameters. The first one is @.Office and the second one is @.Account.
5. Make sure you have the correct order Office, then Account
6. Set @.Office data set to your Office data set.
7. Set @.Account parameter to the Account dataset. Make sure to select a default value from query.
This will allow you to have a dependent parameter. Once you select the values in Office then the default will kick out the values for Account.
The way in which you explained the orginal message I am not sure will ever work
|||
Hi Thanks for your valuable reply.
I m using MS visual studio 2005, It seems like it is not supporting variablethe @.param syntext,
How to implement parameter cascading in visula studio 2005?
I found on cascading parameter implementation on MSDN for Server Business Intelligence Development Studio not for visula studio 2005.
http://msdn2.microsoft.com/en-us/library/aa337426.aspx
Thanks
Novin.
|||Hi
The implementation is working it was a silly mistake from my side i have assign wrong data type the the paremeter.
Thanks,
Novin
Cascading Parameter with ODBC
I have 2 parameter One is Office (Listbox) another Account(list box) , where Account list box filling is dependent on the Office selection.
In published report when I select the office from list box the page got refreshed but it not updating the account list, the account list box looks diabled?
I have define the two parameter and for the second parameter here is the query
="SELECT ACCOUNT_ID, ACCOUNT_NUMBER FROM MLGDB2.A_ACCOUNT " &
"where OFFICE_ID =" & Parameters!paramOffice.Value &
"ORDER BY ACCOUNT_ID "
To access parameter i need to use Parameters!paramOffice.Value with ODBC driver instead of @.param.
Can any one help me.
Thanks
Novin
Hi Novin,
This is something that I have done many of times. I will try and explain how to do this correctly.
1. Make a data set with your Office list
2. Make a second data set with a select statement like:
SELECT
ACCOUNT_ID,
ACCOUNT_NUMBER
FROM MLGDB2.A_ACCOUNT
WHERE OFFICE_ID in (@.Office.Value)
ORDER BY ACCOUNT_ID
3. Make sure you add a parameter to the second data set called @.Office on the parameter tab in the data set.
4. Now go to your report parameters and create two parameters. The first one is @.Office and the second one is @.Account.
5. Make sure you have the correct order Office, then Account
6. Set @.Office data set to your Office data set.
7. Set @.Account parameter to the Account dataset. Make sure to select a default value from query.
This will allow you to have a dependent parameter. Once you select the values in Office then the default will kick out the values for Account.
The way in which you explained the orginal message I am not sure will ever work
|||
Hi Thanks for your valuable reply.
I m using MS visual studio 2005, It seems like it is not supporting variablethe @.param syntext,
How to implement parameter cascading in visula studio 2005?
I found on cascading parameter implementation on MSDN for Server Business Intelligence Development Studio not for visula studio 2005.
http://msdn2.microsoft.com/en-us/library/aa337426.aspx
Thanks
Novin.
|||Hi
The implementation is working it was a silly mistake from my side i have assign wrong data type the the paremeter.
Thanks,
Novin