Ssrs 2008 r2 using parameter values

In an existing ssrs 2008 r2 report, I have a requirement from a user where they want to add 2 more parameters to the report. Right now there is an option where the user can choice to generate report1, report2, report3, report4, report5, report6, report7,
report8, and/or any combination of the reports I just listed.
This is setup by using an expression in the visibility property for each of the 8 tablixes.
For your information, the following is an example of how to display one of the reports or not:
=iif(InStr(join(Parameters!report.Value,","),6)>0,false,true)
Now the user wants to be able to add the parameters of customer and inventory_item based upon if report7 and/or or report8 is selected.
Now can you tell me the following:
1. Would you show me the code I can use in the dataset to select report7 and/or report8?   
 2. If the above is not possible to select specific reports, then would the dataset query need to look something like: where @report is null or where @report is not null? What would you suggest?

Hi midnight_car,
According to your description, you have specified visibility for each tablix in a report with IIF() function. When you select 7 or 8, you want to add an additional parameter to filter displayed tablixes, right?
In Reporting Services, since we can’t specify the visibility of a parameter as an expression, we could add a cascading parameter. When the first value is 7 or 8, then selected values from the cascading parameter can filter the displayed tablixes. Please
refer to steps below:
1. Sample data.
2. Create a new dataset with the query below:
select distinct SalesTerritoryRegion as region from dbo.DimSalesTerritory
where SalesTerritoryRegion=
case when 3 in (@report)or 4 in (@report)
then SalesTerritoryRegion
else 'NA' end
3. Specify the parameter @region using the new dataset.
4. Query in main dataset like below:
select SalesTerritoryRegion as region,SalesTerritoryCountry as country,SalesTerritoryGroup as [group] from dbo.DimSalesTerritory
where SalesTerritoryRegion= case when 3 in (@report) or 4 in (@report)
then @region
else
SalesTerritoryRegion end
4. Preview the report.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support

Similar Messages

  • Ssrs 2008 r2 use parameters for sorting purposes

    In an ssrs 2008 r2 report, I have a report where a user wants to sort a report based upon the following parameters:
       1. lastName,
       2. firstName, 
       3. studentNumber,
       4. [School Name].
    The above is the default order of how the user wants to be able to sort the report.
    The following is the definition and the columns that are to appear in the report:
             studentNumber varchar(15)
     ,lastName varchar(40)
     ,firstName varchar(35)
     ,[School Name]  varchar(40)
     ,[School of Assignment] CHAR(3)
     ,grade varchar(4)
     , Description varchar(50)
     ,[Beginning Date] smalldatetime
    The above columns are all contained in one tablix.
    The user wants to be able to sort the report by changing the parameters that I just listed
    above.
    Thus can you show me code and/or point me to a url that would show me how to allow the user to sort
    the report in any order based upon the 4 parameters listed above?

    The interactive sort is not what the user wants. The user wants to be able to change the default sort order by using a sort parameter value.
    I know that the tablix and the detail rows of a report have a sort option. I want to be able to connect, the sort parameter values with the tablix sort. I have seen on the internet where each sort parameter value can be represented with a number value.
    I don't  care what is easier, I want to do what the user is requesting. Thus can you show me code on how to accomplish this goal?
    Ok. I just gave you a better option
    If you still want it to be based on parameters you can add one more parameter to your report called SortBy with values of your fields. Then inside sor expresson for your tablix use an expression like
    =Fields(Parameters!SortOrder.Value).Value
    and it will automtically sort based on field you choose from parameter
    Only thing you need to make sure is that values given for SortBy parameter combo should be exactly same as your field names used in your report dataset.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Ssrs 2008 r2 pass mutiple values to stored procedure that is being called

    In an SSRS 2008 r2 report, I am currently calling a stored procedure called spRoom. I obtain the results of the stored procedure by creating a  temptable called #roomReults
    The temp table that I am creating and using to obtain results looks like the following:
    CREATE TABLE #roomResults(
                     studentID VARCHAR(15),
       endYear SMALLINT,
                     calendarID INT) 
    INSERT  #roomResults
           EXEC [dbo].[spRoom] @endYear, @calendarID 
    Currently I am only passing in one value for both paramters called: @endYear and @calendarID. However now I want to pass
    in several values to each parameter.
    I want to change the sql to look like the following:
     EXEC [dbo].[spRoom] IN (@endYear), In (@calendarID)
    The above gives me syntax errors.
    Thus I am wondering if you can show me how to change the sql listed above so that that I can pass in more than one value from the SSRS report parameters called @endYear and  @calendarID to the stored procedure called [spRoom]?

    Wendy
    What version  are you using? Since SQL Server 2008 we  can use table valued parameter
    Create a user-defined data type with a single column.
    Develop a procedure with a table variable as an input parameter.
    Declare a table variable of the type of the user defined data type.
    Loading 10 records into the table variable and pass the table 
    variable to the stored procedure.
    create type tt_example AS TABLE
     (spid int)
    go
    create procedure usp_example
     @spids tt_example READONLY
    AS
     SELECT *
     FROM @spids
    GO
    declare @spids tt_example
    insert into @spids
    select top 10 spid
    from sys.sysprocesses
    exec usp_example @spids=@spids
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Ssrs 2008 r2 pass paramter value to a sort

    In a new SSRS 2008 r2 report, I am going to be using sql within a dataset and not a stored
    procedure since will I need to pass multiple values to each parameter.
    One of the parameters that I will be working with is allowing the user to be able to pick what items
    they want to sort on. The sort will have 3 items that will be always be sorted on first which are:
    year, and school_number.  The users will be able to pick additional items to sort on like grade, and teacher.
    The following is the sql that I have so far:
    select year,  school_number, grade,teacher,room,course_number, course_name
    from dbo.school
    order by  year,  school_number, several parameter values.
    Thus I am wondering if you would modify the sql above so that I can allow the user to sort on the additional parameters in any order like grade,teacher,room,course_number, course_name?
    If any part of my request is not possible, I am wondering if you would show me what is possible in the sql?

    Hi jazz_dog,
    According to your description, you want to sort the report by grade,teacher,room,course_number or course_name based on a parameter selection. If in this case, we can add an expression in sorting to achieve your requirement:
    Add a parameter named Sort with the available values below to the report:
    Label: grade                                       Value: grade
    Label: teacher                                     Value: teacher
    Label: room                                        Value: room
    Label: course_number                         Value: course_number
    Label: course_name                            Value: course_name
    Add a the expression below to the tablix Sorting:
    =switch(Parameters!Sort.Value="grade",Fields!grade.Value,Parameters!Sort.Value="teacher",Fields!teacher.Value,Parameters!Sort.Value="room",Fields!room.Value,Parameters!Sort.Value=" course_number",Fields!course_number.Value,Parameters!Sort.Value="course_name",Fields!course_name.Value)
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Ssrs 2008 r2 date parameter not working all the time

    In an SSRS 2008 r2 report, I am not getting some records selected when I run the report in the ssrs 2008 r2 report.
    However when I run the sql in ssis manager, the records are selected. Thus I am trying to determine why some of the records are not selected whe running the ssrs report.
    In the table called 'transactionfile', the fields that I am trying to determine where there is a problem is the following:
    SchoolNumber (varchar(50),null), and
    TransactionPaymentDate (varchar(50),null).
    Examples of data are SchoolNumber = '121' and TransactionPaymentDate = '04162014'
    In the SSRS report, the parameter value for @SchoolNumber is text and the parameter value for @EndDate and @StartDate is date/time.
    The following is the query I am having a problem with:
    SELECT  s.SchoolNumber,      
          CONVERT(smalldatetime,substring(TransactionPaymentDate,5,4) + '-' + substring      (TransactionPaymentDate,1,2)+ '-' +
    substring(TransactionPaymentDate,3,2)) as        TransactionPaymentDate
     from [eF].[dbo].[transactionfile] f
           INNER JOIN
        [eF].[dbo].schools] s      
        on rtrim(ltrim(s.SchoolNumber)) =rtrim(ltrim(f.SchoolNumber))
     where  rtrim(ltrim(s.SchoolNumber)) = rtrim(ltrim(@SchoolNumber))
          AND
          Cast(Right(TransactionPaymentDate,4)+Left(TransactionPaymentDate,4)  as Date)
            >= @StartDate
         AND
       Cast(Right(TransactionPaymentDate,4)+Left(TransactionPaymentDate,4)  as Date) <= @EndDate
    Thus could you suggerst what could be wrong when selecting some records by date?

    First check whether transaction payment date has 8 digit or not. In yes then try the below query,
    SELECT s.SchoolNumber,
    CONVERT(smalldatetime,substring(TransactionPaymentDate,5,4) + '-' + substring(TransactionPaymentDate,1,2)+ '-' +
    substring(TransactionPaymentDate,3,2)) as TransactionPaymentDate
    from [eF].[dbo].[transactionfile] f
    INNER JOIN [eF].[dbo].schools] s
    on rtrim(ltrim(s.SchoolNumber)) =rtrim(ltrim(f.SchoolNumber))
    where rtrim(ltrim(s.SchoolNumber)) = rtrim(ltrim(@SchoolNumber))
    AND
    cast(substring(TransactionPaymentDate,5,4) + '/' +
    substring(TransactionPaymentDate,1,2)+ '/' +
    substring(TransactionPaymentDate,3,2) as date) between @StartDate AND @EndDate
    Regards, RSingh

  • Crystal Reports 2008 SP3 Additional parameter values are needed

    I recently upgraded to Crystal Reports 2008 SP3, and now when I try an export a report from the Crystal Reports Designer, I get the error "Additional parameter values are needed before this report can be saved or viewed with data.  Click 'Ok' to enter the missing values or 'Cancel' to proceed without data".  I am trying to export the report to Crystal Reports format.  The report is getting data from a MS SQL 2005 stored proc. I tried building a new simple report (just took all the fields in the result set and put them in the details section) using the same stored proc, and get the same error when I try to export.  
    FYI, before I try to export I always preview the data in the report, so the parameters are defiantly set correctly.
    This was working correctly in Crystal Reports 2008 SP2.

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Crystal reports 2008 Set optional parameter value

    Hi,
    I'm working with .net Visual Studio 2008 C# and Crystal reports 2008 (Crystal.Decisions) and when I try to set a parameter to optional and set its value to no value, it returns the error: "Invalid parameter name", here is my code:
    foreach (CrystalDecisions.Shared.ParameterField param in Report.ParameterFields)
                            if (!param.HasCurrentValue &&
                                !Report.DataDefinition.ParameterFields[param.Name].IsLinked())
                                switch (param.ParameterValueType)
                                    case ParameterValueKind.NumberParameter:                                  
                                        param.IsOptionalPrompt = true;
                                        param.CurrentValues.IsNoValue = true;                                  
                                        break;
    I'm doing this because some of the parameters can be left null, and in this case I don't want to show the parameter prompt.
    In past versions of Crystal (such as Crystal Reports 11.5) we had the chance to left the parameter value null and did not showed the parameter prompt dialog, and this behavior repeats in a lot of reports.
    thanks in advanced

    Please don't post the same question more than once. This is a public forum so be patient.
    Install SP4 and test again.
    Try these samples:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsSDKSampleApplications
    Don

  • Ssrs 2008 r2 use 'Globals!ReportServerUrl in url

    In a SSRS 2008 R2 report, I am able to have the users open a pdf document in a new window by using the following code in the action field of a textbox property:
    ="javascript:void(window.open('http://test1.op.org/ReportServer/Pages/Resource.aspx?%2fboards%2fImages%2fHS.pdf'))".
    My goal is not to hard code the url path. I would like the url path to be dynamic based upon which report server the ssrs report is running from.
    Basically I would like to replace the
    http://test1.op.org/ReportServer with the Globals!ReportServerUrl variable that report server has a available.
    I would like to replace the above expression with the following:
    ="javascript:void(window.open('Globals!ReportServerUrl/Pages/Resource.aspx?%2fboards%2fImages%2fHS.pdf'))". However this expression does not work.
    Thus can you tell me how to use the Globals!ReportServerUrl ssrs item with the javasctript window open statement so that the expression works correctly?

    Hi Wendy,
    If we are put Globals!ReportServerUrl expression in the “”, in Reporting Services, it will recognize it as a string data. So, it cannot display as report server URL.
    Please refer to the following expression:
    = Globals!ReportServerUrl & “/Pages/Resource.aspx?%2fboards%2fImages%2fHS.pdf”
    If you have any questions, please feel free to let me know.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • SSRS 2008 R2 - Using Action to call a report with MultiValue Parameters

    I have a report uses project names as parameter(Multi value) and display some data. I want to call this report from some other report on a click (drill down). This report has a program row where it aggregates the data, underneath Programs, I have
    list of projects(group). When I use Action on the individual projects, it takes me to the appropriate project ( I used
    Fields!ProjectName.Value). However, when user clicks on the program, it should pass the group of projects within that program to the called report. With expression,  Fields!ProjectName.Value, it only select one random project (may be first/last from
    the query) and display records. I tried Join(Fields!ProjectName.Value, ",") and Fields!ProjectName.Value(0) but now it doesn't select a sengle project. Can someone help please?

    use In instead =

  • SSRS 2008 - create the interval values in y-axis dynamically

    Hi All - 
    I have a report which has number values in y-axis and date in x-axis. This is a clustered column chart, the problem is for a particular date if one of my value is very huge say (in Thousands, Ex: 10000) and another is small (Ex: 120). In this case my small
    value bar is hardly visible.
    Hence in this case, I was looking around for an option like below, the y-axis interval needs to change dynamically based on value (i.e) until a threshold value the interval should be fixed say incremented by 120, once it reaches a threshold (Ex: 360) it
    should be auto (i.e) if the max value for that date is 3800 after 360 the interval needs to be in thousands or more based on the need.
    So based on the above explanation i would want the values like below for my y-axis -> 120, 240, 360, 2000, 4000.
    Please let me know in if this is possible

    Hi smurug,
    Based on my understanding, you are creating a 3-D Clustered column. And you want to make the Y-axis values distribute uniformly, right?
    In Reporting Services, there is a scale break feature which can display two distinct ranges in the same chart area, then to make Y-axis values distribute uniformly. However, this feature is not supported in 3-D Clustered columns.
    For more information, please refer to this article:
    Displaying a Series with Multiple Data Ranges on a Chart (Report Builder and SSRS).
    In your scenario, if you want to make Y-axis values distribute uniformly, you can add a secondary vertical axis to display those too larger values. Please refer to steps below:
    1. Go to Series Properties, enable secondary vertical axis, then design the report like below:
    2. Preview the report.
    Reference:
    Adding a Secondary Axis to a SSRS Chart
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • How to set the default selection to "Select All" in a Multi valued parameter in SSRS 2008?

    Hello Everyone,
    How to set the default selection  to "Select All" in a Multi valued parameter in SSRS 2008?
    Regards
    Gautam S
    Regards

    You need to specify "Default Values" in the report parameter property. Choose similar option used in the "Available Values" option, this will allow the parameter to check "Select All".
    Regards, RSingh

  • Ssrs 2008 want parameter default values to display

    In an ssrs 2008 report, I want to add a parameter called Processed and have default values set so the
    user does not have to select the parameters. The problem is the default parameters are not preselected
    when the report is executed.
    The following is the query for the dataset that is used for the parameter called Processed. This
    is used under available values.
    select DISTINCT IsNull(Processed,'') as Processed,
    CASE IsNull(Processed,'')
      WHEN 0 then 'Non Processed'
      WHEN 1 then 'Processed'
      END AS label
    FROM [Items]
    where Processed in (0,1)
    order by label
    The default values are set to 0 and 1.
    The column called Processed as defined as 'bit'.
    Thus can you tell me what you think could be wrong? Do I need to specify the bit values as
    something else? If so, how should I refer to the values for bit?

    Hi wendy,
    According to your description, this issue can be caused by the values returned by the query. We can try to execute the query in Query Designer to check which values will be returned. Maybe it only returns one value (0 or 1). Then the available values for
    the Processed parameter have only one value. So the default values will not be preselected when the report is initially run.
    Besides, we can also try to use the same query as the default values for the parameter to check the issue again.
    Hope this helps.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Ssrs 2008 r2 parameter values

    In a new ssrs 2008 r2 report, I need to display 2 of the parameter values in the heading of the report. One of the parameter values in the name and customer number. The second heading value is the city and state where the particular customer is located at.
    The customer table has the following values:
    a. cust_id int primary-id,
    b. customer_name varchar(50),
    c. cust_address1 varchar (50),
    d. cust_address2 varchar (50),
    e. cust_city_state varchar(40),
    f. cust_zip_providence varchar(30),
    g. cust_country varchar(30).
    Thus I need to place the  paramter values of customer_name and cust_city_state that are obtained from a dropdown list in the heading.
    when I try =first(customer_name) in the heading, the value is only good for the first customer name. After that, the wrong parameter value is displayed.
    Thus can you tell me and/or show me code of what I can do to place the parameter values
    of customer_name and cust_city_state in the heading of the report?

    Follow below steps,
    1. Create 3 Data set.
     DS1 = select * from customertable
     DS2 = select distinct customer_name from customertable
     DS3 = select distinct cust_id from customertable
    2. Add two parameter, customer name and customer number
     --------parameter 1
     - supply Name property for 1st parameter
     - datatype for the parameter is string
     - Available value property, Select dataset DS2, Select Field Value as "Customer_Name"
     --------parameter 2
     - supply Name property for 2st parameter
     - datatype for the parameter is string
     - Available value property, Select dataset DS3, Select Field Value as "Cust_id"
    3. Add a blank tablix/table.
     -- Select TableRow2 and right click to add new group i.e insert group.
     -- Group properties window will be openned,
     -- Select Group On Expression 1st.
     -- Select the parameter(Parameter1/customer name) by double clicking in the expression window
     -- Select Group On another Expression 2nd.
     -- Select the parameter(Parameter2/Cust Id) by double clicking in the expression window
     -- Now in the general tab you need to checked "Repeat Group Header"
     -- press ok to close the group properties window.
    4. Now from DS1 drag the field City and State in TableRow3 columns.
    5. Drag the Customer Name and Customer Id/Number in TableRow1.
    6. In case if First(Fields!CustomerName) appears then remove First function as simply "Fields!CustomerName". Similarly for Customer Number.
    7. Finally we need to set the filter condition of the table property. Open the table property by right clicking. On the "Filter" tab choose the expression as "Fields" items and double click "CustomerName" to add in the expression. Similarly add second
    field "CustomerNumber" in the expression. Check the operator "=" and choose the value as "Parameter" items respectively.
    Regards, RSingh

  • How to Update the oracle toad column value in table by using SSRS 2008

    Hi Team,
    How to update the oracle DB table column value by using SSRS 2008.
    Can any one help me on this.
    Thanks,
    Manasa.
    Thank You, Manasa.V

    Hi veerapaneni,
    According to your description, you want to use SSRS to update data in database table. Right?
    Though Reporting Services is mostly used for rendering data, your requirement is still can be achieved technically. You need to create a really complicated stored procedure. Pass insert/delete/update and the columns we need to insert/delete/update as
    parameters into the stored procedure. When we click "View Report", the stored procedure will execute so that we can execute insert/delete/update inside of the stored procedure. Please take a reference to two related articles below:
    Update Tables with Reporting Services – T-SQL Tuesday #005
    SQL Server: Using SQL Server Reporting Services to Manage Data
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Changing the value of a parameter that has been passed into an SSRS 2008 R2 report

    I support 200+ reports that all use stored procedures and have many drill downs with built in URLs.
    I want to do the below to avoid creating a brand new parameter that I will have to add to literally hundreds of places.
    We have what I'll call Param1 that receives a value from the user.  That Param1 is passed to the stored procedure(s) for the report and also embedded in any Action URLs for drill downs to other reports from that report.  All works great.
    Now I have a need to concatenate a string to whatever value they supplied which provides context for the environment in which they are running.  The reason I want to do this instead of creating a new parameter is because I need this in all my reports
    and as stated above I would have to make 100s of changes to make that happen.  If I can figure out a way to concatenate a value to the existing Param1 value I can greatly reduce the number of changes.
    I can't seem to be able to find a way to modify the value on an existing parameter that is passed into the report prior to report execution.
    I get an error when I simply try to concatenate something to the parameter in its Default property.
    I can't find a way to update a parameter value in the Report Code block.  There don't appear to be any methods available on the Parameter Collection to set the value of a parameter.
    Any ideas?
    Thanks!
    Nathan 

    Create a new parameter. Mark it internal, set it's value by expression to:
    =User!UserId+"MyNewValue"
    and pass it to the proc?
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

Maybe you are looking for