Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / June 2005

Tip: Looking for answers? Try searching our database.

Cascading Parameter Defaults

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 24 Jun 2005 20:45 GMT
I've had good luck with driving reports with cascading parameters and
parameters with defaults.  So far though, I've been unable to combine these
concepts.

Using the example mentioned in BOL, I'd like to have a division parameter
choice drive a department parameter dropdown.  When the department dropdown
is populated, is there any way to specify a default value?  So far, my
attempts to do so have failed - with no default being chosen and no errors
appearing.

Does anyone know how I might be able to accomplish this?
Frank - 30 Jun 2005 23:35 GMT
I was able to use defaults with cascading parms.  In my scenario, I wanted
the user to choose the division (I'm actually using something else), but then
have the option to choose the department.  Basically, the report would show
data for the entire division if the department parm wasn't choosen.

The only way I could get this to work was to use a default for the
department parm.  I set the default to "non-queried" and the formula equal to
=""  (and empty string).  Also, the department parm is checked off to allow
null and blank values.

At first this didn't work because the default value must be a valid value in
the department dataset that populates the dropdown.   My fix was to union in
a select statement tothe dataset with the default empty string value.  Here's
that sql:

SELECT '' DeptID, '' DeptName
UNION ALL
SELECT DeptID, DeptName FROM DeptTable
WHERE DivID = @DivID
ORDER BY DeptName

Now, when the division dropdown is choosen, the cascade parm populates the
department dropdown.  But since the default is set to "", and "" is a valid
choice in the recordset - RS is happy.  

The only thing else I had to do was have the actual report dataset know how
to handle the department as an empty string.  No biggie.

Mike, to apply this to your scenario, I think the key is making sure the
default value is always in the dataset for the dept dropdown.

Hope this helps, Frank
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.