.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

how to set default value to one parameter based on another parameter value

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server


I have two parameters in a SSRS2008 report which are named as,

1) @showclient - datatype bit

2) @client - datatype varchar. ( This is dependent on @showclient parameter)

I want an expression to set the default value for @client parameter to be " noclients" when the value of @showclient parameter is set to 0( zero).

Thank you.

View Complete Post

More Related Resource Links

How to change the Default Value of the Parameter to "Query Based"


Hi I have a Report which i deployed into my localhost.

In the Report Manager, Report Parameter Properties, I unchecked the HasDefault option for which Default value is coming from some Query.

When I retry to Set the Default Value to Query Based, Its not taking.

Need Help.

ssrs 2008 R2 - report parameter with no default set throws java script error

We have recently upgraded from SQL Server 2008 to SQL Server 2008 R2....I am experiencing a problem with my report parameters on my SSRS reports. It seems that my report parameters that I do not have a specified 'default' value throws a java script error when I try and run/render the report under R2.  As soon as I put a 'default' value on the report param, everything is fine.  However, that is not the behavior we need for our reports...the user needs to pick their selection. Can anyone shed some light on this, it seems to be an AJAX problem...I need to be able to have report parameters with a list of values, but no 'default' value on the parameter.

Parameter prompt based on culture

Hi All, I am using ssrs 2008. in my report i am using culture as fr-CA.in parameter section one bollean param is there. So it wioll display : Select  :  True false . but i need true false text in french.i set up the Report culture as fr-CA.but it is still showing true and false in english. is it possible to resolve? Thanks VRU

Load View and Partial View (Master/Detail) with default parameter(s) ?

MVC newb.  Members view (index) that lists members that users can select to show a partial view in the same view with details for the selected member Uses jquery (Ajax.ActionLink) to call a partial view method in the members controller to then load the members detail section Works fine up to here....but I'd like to load the partial view with "member" details for a default or random member on initial load -- ie not through the Actionlink selection How do I invoke the partial view method on the initial load?  I'm sure this is basic stuff but still still getting my head around the mvc "way" Can someone point me to an example or explanation somewhere?  (not turning anything up on my searches thus far)   thanks in advance!!

In a SQL2005 Reporting Subscription I need to revert the parameter back to the default value "overri

Hi, In a SQL2005 Reporting Subscription I need to revert the parameter back to the default value "override-default." This value was updated to a specific value and now I am unable to have the report updated daily with the new data.  Within Report Manager, drill into the specific report, click on the properites tab, and chose the second link on the left "Parameters."  For the value in question (DataID) someone unchecked the "Has Defalult" button.  This results in the "Use Default" check box being removed from the UI in the Subscription tab.  I can get the Use Defalut box back by entering a specific value in the 'defalut value' but the report runs against that one value (instead of updating daily.) Before the "Has Defalult" was unchecked, the Defalut Value is a buttton, which says "Override Defalut."  It is this 'button' that I am trying to get back. I've googled this and looked thru MS kb without luck.  (I think it maybe a matter of using the right language...) Thank you for your reply.   Victoria  

Parameter value filter based on user in SSRS (SharePoint Integration mode)


Hello..we have a reuirement where we have to filter the parameter value in the drop down based on the user who is accessing the report. We have form and Windows authenication enabled in the SharePoint site (some users will be from inside the network using windows and some will be accessing the site using internet using the Form Authentication).

Please let me know what would be the best way to handle this reuirement? Do we need to create a separate table  and store the User Information along with the parameter values they have access to, pass the userid from Report to db and then fileter the records using this table? OR Can we create a SharePoint List to maintain the user access information and then directly fetch the user information from the list using T-SQL to filter the records?

Please let me know your suggestion...


Parameter error in the web based application


Hello Everyone,

I am working on a web based application wherein I have a created 2 dropdown lists for the user to select. If the user does not select any value from any or both of the dropdown lists, they should see a message- 'Please a select a value for trade code' or 'Please a select a value for direction'. Instead I am getting this development error:

'Procedure or function 'usp_AdminPageCustomerGroupingSearch' expects parameter '@tradecode', which was not supplied.'

As I am still novice to asp.net or C#, I am unable to find the correct code to catch this error and display the relevant message to the user. Could someone please help me with this ? The following is the slice of the C# code which is related to the dropdown list:



 void populateGV()DataView dv = new DataView();<

Cannot set parameter default value



I'm using SSRS 2008 running off a SSAS 2008 cube. My report dataset is running the following query:


In the properties for the DateDateHierarchyCalendar parameter, I set the Available values to Get Value From Query, and this points to the following query:

WITH MEMBER [Measures].[ParameterCaption] AS [Date].[Date Hierarchy - Calendar].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [Date].[Date Hierarchy - Calendar].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [Date].[Date Hierarchy - Calendar].CURRENTMEMBER.LEVEL.ORDINAL SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Date].[Date Hierarchy - Calendar].ALLMEMBERS ON ROWS FROM [MyCube]

The Value field is set to ParameterValue and the Label field is set to ParameterCaptionIndented.

I then have a named set in SSAS called [Calendar Current Month] which looks like the following:


BDC: Cannot create default instance on a Parameter with DircetionType 'Out', 'Return' or 'SqlRe



I created a ADF with the Application Definition Designer. Some things are allready working, some don't. One thing I want to achieve is the filtering on wildcard filters. I defined a method for a "Customers" table and added two "in"-parameters for "Name" and "FirstName". I also added an instance of type "Finder". Now I want to receive some data from this query with help of the "Execute" feature of the Application Definition Designer. But this return only an error "Cannot create default instance on a Parameter with DircetionType 'Out', 'Return' or 'SqlReturn'". What am I doing wrong?

Thanks for any help!



Report viewer control is is displaying parameter item 'select a value' even when the default param



I am using SSRS 2008 R2,

I have set the default parameter of dropdown and in the output "select a value" item text is removed ,also in the Report Manager 'select a value' removed .

But when I am displaying the same reports in the ReportViewer control as ReportViewer1.ServerReport  in the the vs 2010 asp.net project the item select a value is reappearing in the output.

Could you please help me remove the default item text 'select a value' from the ReportViewer control aswel.


SSRS 2005 - Change 2nd Parameter Value based on 1st Parameter Value (Non-queried)


I am wanting to filter my report based on Fiscal Year.  I have the first parameter as @STARTDATE and 2nd parameter as @ENDDATE.  The values for both of these are hardcoded in non queried.  When the user selects the @STARTDATE , I want to automatically set the value for the @ENDDATE parameter.  I'm doing it this way because I'm using BETWEEEN in my SQL Query.  Ideally, I will just have the @ENDDATE value hidden if possible.

So for example:

@STARTDATE has values of 10/1/2009 and 10/1/2010.
@ENDDATE has values of 9/30/2010 and 9/30/2011.

When @STARTDATE is selected to 10/1/2009, set the @ENDDATE value to 9/30/2010.
When @STARTDATE is selected to 10/1/2010, set the @ENDDATE value to 9/30/2011.

Any idea how/if this can be accomplished?

Default Parameter Values not Updated when Report Updated


This is either a bug or really wierd behavior by design that needs to be rethought in the near future.

I'm an enterprise developer on a commercial product that integrates and leverages reporting services.  We install a sizable number of reports automaticly as part of our production isntallation or upgrade.  I have a recent QA bug on that process that I find mystifying.

We install reports through calls to the CreateReport web service and its worked pretty well.  Recently, I had a report with a parameter whose definition changed.  Specifically, the default value of the parameter changed from 'All' to 'Select' and corresponding changes were made to the valid values list of the parameter.  When the report is installed, it works just fine.  But when the report is created as part of an upgrade to an existing system, the report for the most part gets all the expected changes but the new default value is not picked up.   Instead, it seems to stay hung on 'All', with the result that the parameter remains in a state of having unresolved dependencies ('All' no longer appears as a valid value) and as a result, breaks our interface (which was designed for single rather than multistep entry of parameters).

I know that some properties are not reset when calling CreateReport. &n

SSRS 2008 w/CU6 - Parameter Default Value Refresh Issue.



We are experiencing trouble with a parameter default value (parameter 2) not refreshing when it's parents parameter value is updated (parameter 1).  The problem parameter (2) has specified values in the available values, and has a dataset that loads the default values depending a parameter above it.

The first time that parameter 1 is selected, parameter 2 is updated with the correct default value... BUT, when parameter 1 is changed, parameter 2 does not update.

If I change the problem parameter's (2) available values to the dataset where the default values come from, it works fine, but that doesn't fill the business requirement of this report.  I also tried setting parameter 2 properties to "always refresh" but that doesn't appear to refresh the default values.

What else can I try?








Parameter enabling based on selection in another parameter.



I have a parameter Owner with 1,2,3 options in dropdown.

On selection of option 1 , a country parameter should be enabled with all countries' values defaulted.

Option 2 should enable Region parameter with all the Regions values selected and country parameter should be displayed.

Option 3 should disable both Region & Country Parameter.

Please help me in achieving this.

I am using SSRS 2005 with Enesys tool as add on.

Thanks in advance.



Most Efficient Default Value for a Parameter


Posting this here because it's really an MDX question.  I have a ssrs report with 10 parameters.  Many of them may not be filled in when the report runs.  The report is run by an asp.NET application so the parameter values are hidden from the user.  What is the most efficient value that I can use for an "all" parameter if I don't have a list that I have to match (ie it's free text rather than dropdown type).  By "all" parameter, I mean a parameter that is not needed on this run of the report.  I can just use dim.hierarchy.ALLMEMBERS or dim.hier.[All] like I normally would if there were a dropdown or something, but in this case could I use something like "{}" or "[CubeName]" and save the engine some work?  I essentially want to omit the parameter.

If it matters, the way I am writing my parameters into the mdx is to use the nested subcube statements in the from clause, and the parameter filters are not re-done in the where clause.

I hope I have been clear here..



Setting a default value for a Unit type parameter


I want to include an optional parameter in a function statement that is of the type Unit. For example:

Public Shared Function NewTable(Optional ByVal TableWidth As Unit) As Table

Optional parameters require a default value, but I cannot figure out how to set a default value for a Unit type. Help! Thanks!

Querying a SharePoint List: Creating a Report Parameter based on a SharePoint List field

I have been struggling with this problem over a week now and am at my wits end.   I have created a RS(2005) report and am currently querying data from a SharePoint List.  If anybody is interested in seeing how I set it up I follow this simply walk through on Code Project.  http://www.codeproject.com/KB/reporting-services/ReportFromSharePoint.aspx.  

I need to create a custom report parameter and reference a field that I have created in my SharePoint list.   When I run the report I would like to 'Filter' the result set with the value selected in the report parameter field.  I have looked anywhere and everywhere and don't know if I am over complicating this problem but I have yet to find a solution. 

Please and Thank you
Software Engineer
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend