How to include NULL in multi value parameters

Good Morning,
I'm posting this question after i tried other links and was not successful. I'm using a report builder to create a report. SSRS2008R2.
I have a sql to get the data into the data set. Source is ORACLE DB. The query is pulling lastname,firstname,dob,joindt,divname. I created a parameter in the SQL :
WHERE DIVNAME IN (:divname).
I created another dataset (select distinct divname from table2) and selected the paramter properties to get the values from the second dataset and selected it to be multivalued. However the user wants to see the NULL's or BLANKS that are in the DIVNAME.
Can some one please tell me as how i can acheive this?
When i run the query in the sql plus i get (null) values as well, but when in the second dataset i run the query i just get the DISTINCT divnames and a  "BLANK" field (in SSRS)
Thanks

Hi thinkingeye,
According to your description, you want to include the null values in your multiple values parameter. Right?
In Reporting Services, we can't allow both null values and multiple values in a parameter. In this scenario, since you have created a dataset for getting distinct divname, we suggest you try "select distinct isnull(divname,-1) from [table]" in this
dataset so that all the null values will return -1. Also using isnull() function to replace divname in other query. This might be the most effective work around.
Reference:
Null and Multi-value parameter possible
Include Null Value Multi-Value Parameter list
If you have any question, please feel free to ask.
Best Regards,
Simon Hou

Similar Messages

  • [Forum FAQ] How to configure a Data Driven Subscription which get multi-value parameters from one column of a database table?

    Introduction
    In SQL Server Reporting Services, we can define a mapping between the fields that are returned in the query to specific delivery options and to report parameters in a data-driven subscription.
    For a report with a parameter (such as YEAR) that allow multiple values, when creating a data-driven subscription, how can we pass a record like below to show correct data (data for year 2012, 2013 and 2014).
    EmailAddress                             Parameter                      
    Comment
    [email protected]              2012,2013,2014               NULL
    In this article, I will demonstrate how to configure a Data Driven Subscription which get multi-value parameters from one column of a database table
    Workaround
    Generally, if we pass the “Parameter” column to report directly in the step 5 when creating data-driven subscription.
    The value “2012,2013,2014” will be regarded as a single value, Reporting Services will use “2012,2013,2014” to filter data. However, there are no any records that YEAR filed equal to “2012,2013,2014”, and we will get an error when the subscription executed
    on the log. (C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles)
    Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportParameterException: Default value or value provided for the report parameter 'Name' is not a valid value.
    This means that there is no such a value on parameter’s available value list, this is an invalid parameter value. If we change the parameter records like below.
    EmailAddress                        Parameter             Comment
    [email protected]         2012                     NULL
    [email protected]         2013                     NULL
    [email protected]         2014                     NULL
    In this case, Reporting Services will generate 3 reports for one data-driven subscription. Each report for only one year which cannot fit the requirement obviously.
    Currently, there is no a solution to solve this issue. The workaround for it is that create two report, one is used for view report for end users, another one is used for create data-driven subscription.
    On the report that used create data-driven subscription, uncheck “Allow multiple values” option for the parameter, do not specify and available values and default values for this parameter. Then change the Filter
    From
    Expression:[ParameterName]
    Operator   :In
    Value         :[@ParameterName]
    To
    Expression:[ParameterName]
    Operator   :In
    Value         :Split(Parameters!ParameterName.Value,",")
    In this case, we can specify a value like "2012,2013,2014" from database to the data-driven subscription.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Multi-value parameters and strings with leading zeros

    I have invoice number as a multi-value parameter. Invoice is a string,10 (VBRP.VBELN) .
    Invoice number is my group. If I enter invoices 100 and 200 as parms, then I only get data for invoice #100 (the lowest value entered). But if I enter 100, 0000000100, 200, 0000000200 as parms, then I get data for both invoices. Is there a way to get around having to enter the invoice number in both formats. BTW, if I only enter 0000000100 and 0000000200 then I get no data.
    Selection criteria is (VBRP.VBELN) = ?invoiceno --- parms are defined as allow muliple values and allow discrete values.

    Oops, that's not gonna work with multi-value parameters.  How about:
    if IsNumeric((VBRP.VBELN)) then
      ToText(Val((VBRP.VBELN)), "0") in {?invoiceno}
    else
      (VBRP.VBELN) in {?invoiceno}
    end if
    BTW, the reason why your original formula didn't work was because the "=" should have been "in".  The above is needed only if the (VBRP.VBELN) field might contain leading zeroes.
    HTH,
    Carl

  • Setting multi-value parameters using ReportExecutionService

    Does anyone know how to set multi-value parameters using ReportExecutionService in C#?
    If I have
    rsExec = new ReportExecutionService2005.ReportExecutionService();
    ReportExecutionService2005.ParameterValue[] parameters = new ReportExecutionService2005.ParameterValue[2];
    parameters[0] = new ReportExecutionService2005.ParameterValue();
    parameters[0].Label = "Report_Begin_Date";
    parameters[0].Name = "Report_Begin_Date";
    parameters[0].Value = "4/15/2007";
    parameters[1] = new ReportExecutionService2005.ParameterValue();
    parameters[1].Label = "SalesID";
    parameters[1].Name = "SalesID";
    parameters[1].Value = ???  //Here, this parameter should accept multiple values like 200, 201, 202, etc.
    rsExec.SetExecutionParameters(parameters, "en-us");
    How would I set the SalesID to take multiple values?

    hi
    how to set dynamic parameters values.
    please help me.
    reportexe.
    ParameterValue[] parameters =
    new reportexe.ParameterValue[5];
    if (_parameters.Length > 0)
    parameters[0] =
    new reportexe.ParameterValue();
    parameters[0].Label =
    "mgrid";
    parameters[0].Name =
    "mgrid";
    parameters[0].Value =
    "[DMMGR001MT].[MGR ID].&[10]";
    parameters[1] =
    new reportexe.ParameterValue();
    parameters[1].Label =
    "locid";
    parameters[1].Name =
    "locid";
    parameters[1].Value =
    "[DMDPT001MT].[DPT ID].&[700]";
    //[DMDPT001MT].[DPT ID].&[700] 
    parameters[2] =
    new reportexe.ParameterValue();
    parameters[2].Label =
    "usrid";
    parameters[2].Name =
    "usrid";
    parameters[2].Value =
    "[FILLED BY USER].[USER ID].&[yshah]";
    //[FILLED BY USER].[USER ID].&[yshah] 
    parameters[3] =
    new reportexe.ParameterValue();
    parameters[3].Label =
    "fromdate";
    parameters[3].Name =
    "fromdate";
    parameters[3].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100101]";
    //[FIRST DOSE DATE].[Date Key].&[20100101] 
    parameters[4] =
    new reportexe.ParameterValue();
    parameters[4].Label =
    "todate";
    parameters[4].Name =
    "todate";
    parameters[4].Value =
    "[FIRST DOSE DATE].[Date Key].&[20100131]";
    // [FIRST DOSE DATE].[Date Key].&[20100131]
    this is my code.
    indu

  • Programmatically set Multi-value parameters

    Hi, I hope someone can help.
    I have a .net web application written in VS2008.  I display reports within a report viewer object.  I currently set report parameters within code using the SetParameterValue property within the report document object before passing the document to the viewer.
    This works fine for single value parameters, but I have a report which accepts multi value parameters and I am having problems trying to find any information about if this can be done within my code.  I understand the parameter is an array, therefore am I right in thinking I can pass an array into the SetParameterValue property?
    Any help would be much appreciated.
    Thanks

    Hello Julie
    You do not mention what version of CR you are using in .NET or what version of CR the reports were written in.
    There is a fair number of good threads on this issue in the forum, see if searching comes up with anything.
    Also, use the search box at the top right corner. That will search KBases, articles, Blogs, wikis, etc., etc.
    Oh and sample apps are here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    and the [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23] is a great article to go through.
    - Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to define null or empty value in BAPI function modules?

    Hi,
    I have problem with BAPI functions, where some parameters are mandatory.
    For example: when I try to use HR BAPI's(BAPI_PERSDATA_CHANGE, etc.) I have to insert parameters like SUBTYPE,OBJECTID,LOCKINDICATOR. The PA0002 table that is used from this BAPI doesn't have SUBTYPE, OBJECTID, LOCKINDICATOR, for any of the records that I would like to select.
    So what I tried, was to put a ' ', to indicate that is empty. It returned an error message saying "Make an entry in all required fields". Next tried to put in some values for these fields -- and it returned an error message saying "No data selected from 0002 for this period".
    I also tried to run BAPI_FAMILY_CHANGE that uses data from table PA0021. Here I found some records with  SUBTYPE, OBJECTID fields that were not empty, but LOCKINDICATOR was still missing. So I tried to put LOCINDICATOR value directly in to database (with MS SQL Enterprise Manager).  After that I was able to use BAPI_FAMILY_CHANGE.
    I think that manually inserting data in database is not normal procedure.
    Is there something that I have missed out?
    I mean -- how can I get this to work without inserting data directly in database?
    How can I define null or empty value in BAPI function modules?
    Thank you in advance.
    Best regards,
    Mihail

    Defining an empty value for a parm in a table is easy.
    First get the function's definition from the SAP system
    Second only populate the fields for which you have a value to set
    Third execute the function.
    The JCO takes care of the rest.
    Enjoy

  • How to include input user parameter values in XML report output?

    How can i include input user parameter values in XML report output. I a have a report which can be run by providing start date and end date. I would like to include value of these parameters in XML output to enable me to figure out dates for report, just by looking at XML output.
    Rgds,
    manish

    I think all the XML attributes can contain lexicals. If you bring up the property palette against the report object you can just set the following:
    XML Tag Attributes: myParameter="&<P_1>"
    where P_1 is your user parameter.

  • Optional Multi-Value Parameters in a URL

    I have 3 summary reports, that each need to hyperlink to 4 detail reports. The summary reports use multi-value string parameters that are set to "optional" (this is crystal 2008). I need to construct URLs to support these optional parameters. The opendoc documentation says to use "no_value" as the param argument, but that doesn't work - I get the string "no_value" in the selection criteria which causes it to fail. Ideally, I'd use either lsMMyParam="NULL" or lsMMyParam="", but neither works. Anyone ever done this?

    hi Bob,
    have you tried doing this...
    &lsMPromptName=[]
    lsM prompt / parameter values have to be passed with square brackets as far as i know.
    jamie

  • SQL2 | How to add condition on multi-value field?

    Hello,
    I am trying to perform a JCR query using SQL2 in CQ5.6. For one of the conditions, I wish to compare a multi-value field (E.g. cq:tags).
    How would that be possible? Currenlt, I only managed to compare my query item's cq:tags to a single value (e.g. WHERE page.[cq:tags]='mynspace:mytag').
    Also, is there a syntax reference for SQL2 queries? Currently I have only managed to find something tanglible here : http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/resources/or g/apache/jackrabbit/spi/commons/query/sql2/test.sql2.txt?view=markup
    Best regards, thanks in advance,
    K.

    Hi,
    Below is an example of SQL2 query based on your scenario. you can modify and use it
    SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/geometrixx/en]) and (CONTAINS(s.[cq:tags], 'mynspace:mytag') or CONTAINS(s.[cq:tags], 'mynspace:mytagss1'))
    where root node path  and tags value you can change as per your need. Below is java formation
    StringBuilder query = new StringBuilder();
    query.append("SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([")
    .append(pathToYourPageArea)   //for example /content/geometrixx/en
    .append("]) AND (CONTAINS(s.[cq:tags],'mynspace:mytag') or CONTAINS(s.[cq:tags],'mynspace:mytagss1'))");
    Query compiledQuery = queryManager.createQuery(query.toString(), Query.JCR_SQL2);
    where 'mynspace:mytag' and 'mynspace:mytagss1' is an example and you can change it with variables
    I hope it will help you to proceed. Let me know if you need more information.
    Thanks,
    Pawan

  • Handling multi-value parameters in VS 2005 / Crystal 2008

    In my program I am trying to handle a multi-value parameter using the following code, passing it an array of type string with the values that the user selected, but using the following code returns a 'Missing parameter values' error.
        For Each crParameterFieldDefinition In crParameterFieldDefinitions
            If Not crParameterFieldDefinition.IsLinked And crParameterFieldDefinition.ReportName = "" Then
                crParameterValues = crParameterFieldDefinition.CurrentValues
                crParameterDiscreteValue = New ParameterDiscreteValue
                If crParameterFieldDefinition.EnableAllowMultipleValue Then
                    Dim j As Integer
                    Dim x() As String = Session("FieldDef")
                    For j = 0 To x.GetUpperBound(0) - 1
                        crParameterDiscreteValue.Value = x(j)
                        crParameterFieldDefinition.CurrentValues.Add(crParameterDiscreteValue)
                    Next
                End If
                Session.Remove("FieldDef")
                i = i + 1
            End If
        Next
    I have also tried loading the values into a ParameterValues object and then using ParameterFieldDefinition.ApplyCurrentValues on it, which has been working fine for all of my single value inputs, but using that throws an error about a type mismatch. Any help at all would be appreciated.

    There are a few samples to look at here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Vbnet_win_paramengine.zip, vbnet_win_multirangeparam.zip and vbnet_win_rangeparameters.zip may be good
    Also, [this|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23?quicklink=index&overridelayout=true] article has great info.
    This is all assuming you are on SP3 for CR2008:
    https://smpdl.sap-ag.de/~sapidp/012002523100009989492010E/cr2008_sp3_fullbuild.zip
    SP 3 msi     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
    SP 3 msm     
    https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
    Ludek

  • Multi-Value Parameters to Oracle Stored Procedures via SQL Commands

    Hi,
    When you used stored procedure in CR, you need to declare REF CURSOR, This type of cursor is a dynamic cursor not a static cursor. Hence, you are able to manipulate dataset in this type of cursor.
    Regards,
    Titanium0203

    As far as I know the documentation on CR & stored procedures says that the REF CURSOR has to be a strongly bound one.
    Could you go into a little more detail? Do you mean I should put a multi-valued parameter into a REF CURSOR? Can you post some code snippets here?

  • How to include null values from DB

    Hi,
    I want to see all columns values even though it may contain null values. Right now all null columns are being suppresed by XSQL. Is there any way i can configure this.
    Thanks in advance
    Regards
    Veera

    use the following attribute in the <xsql:query> element (see the xsql help!):
    <xsql:query null-indicator = "yes">..
    </xsql:query>
    Indicates whether to signal that a column's value is NULL by including the NULL="Y" attribute on the element for the column. By default, columns with NULL values are omitted from the output. Valid values are 'yes' and 'no'.(Default value is 'no')

  • How to pass multi-value parameters to DDS (data driven subscription)?

    Using RS2005, how should multivalue parameters be stored in a database field so that a data driven subscription can properly read and use them?  I have so far had no luck using syntax of:
    1)  parm1, parm2
    2)  parm1,parm2
    Do single qutoes need to explicitly wrap the values?  Can you please provide an example and a SQL INSERT statement using parm1 and parm2 to demonstrate what to store in the database field? 
    Thanks!!

    I have skimmed through this an have ran into this problem before but not with RS specifically, but with other ASP.NET apps I have built.  Maybe this work around will help.
    In my database I created a table function I call udf_Split List.  It looks like this: (Can't remember where I got this from, but it's not my own.)
    CREATE
    FUNCTION [dbo].[udf_SplitList]
    @List
    varchar(max),
    @SplitOn
    nvarchar(5)
    RETURNS
    @RtnValue table
    Id
    int
    identity(1,1),
    Value
    nvarchar(100)
    AS
    BEGIN
    While
    (Charindex(@SplitOn,
    @List)
    > 0)
    Begin
    Insert
    Into @RtnValue
    (value)
    Select Value
    =
    ltrim(rtrim(Substring(@List,
    1,
    Charindex(@SplitOn,
    @List)
    - 1)))
    Set @List
    =
    Substring(@List,Charindex(@SplitOn,
    @List)
    +
    len(@SplitOn),
    len(@List))
    End
    Insert
    Into @RtnValue
    (Value)
    Select Value
    =
    ltrim(rtrim(@List))
    Return
    END
    Then, in my query I used the following parameter: QueriedField IN(select value from dbo.udf_SplitList(@Parameter,',')  (I used commas to separate the list, but you can use whatever you like (;,|,*, etc.)
    For you @Parameter would be your DDS list parameter.  Hope this helps.  You can enter your list like Item1,Item2,Item3 etc.

  • Using % to get all including null or empty values

    dear all;
    Please find below the following sample data
    create table t1
    ID varchar2(200),
    time_create date
    insert into t1
        (id, time_create)
      values
        ('A', sysdate);
      insert into t1
        (id, time_create)
      values
        ('B', sysdate);
        insert into t1
        (id, time_create)
      values
        (null, sysdate);
        I have the following sql statement below
        select * from t1
        where t1.id like decode(:id, 'ALL', '%', :id);now, I have a situation where if the user input is ALL, I would like to get all results including the null values or space values, how can I modify the decode statement to do that.
    This is the output I want below for ALL
    ID  TIME_CREATE
    A   5/23/2011 11:14:23 PM
    B   5/23/2011 11:14:24 PM
         5/23/2011  11:14:25 PMAll help is appreciated. Thank you.

    Both work in exactly the same manner.
    The OR condition says either boolean expression needs to be true for the row to be returned, so when :id = 'ALL' (and bind variable is set to 'ALL')- all rows are returned regardless.
    When id = :ID, only values that are equal to your bind variable will be returned.
    You could modify to this to provide even more flexibility
    select * from t1
    where :ID = 'ALL'
    OR like :ID;
    Scott

  • Multi Value Parameters help

    Hi Gurus
    In the main dataset query i created a parameter "where  k.jlocat=:LOC or :LOC is null". These are ORACLE Parameters and hence the :. In another dataset i created a simple query as
    select distinct jlocat as LOC
    FROM TABLE1
    Every thing works fine so far. Now i want to select multiple values for this i edited the @LOC parameter to select multiple values and changed my WHERE CLAUSE in the main dataset as where  k.jlocat=:LOC or :LOC='All'.
    Now when i save and run the report , i cannot click on 'Select All' as it gives me an error:ORA-00907: missing right parenthesis.
    I'm confused as where i'm missing the right parenthesis.Please need advice.
    Thanks

    Hi Pmunshi,
    The error "ORA-00907: missing right parenthesis." occur when you entered a left parenthesis, but missed the closing right parenthesis; or you entered invalid data within the parentheses. Please refer to the link below to see the detail information.
    http://www.techonthenet.com/oracle/errors/ora00907.php
    In a Reporting Services report, if we check the "Allow Multiple values" option, than we need to change the "=" operation to "In" in the query.
    where k.jlocat in(:LOC)
    Besides, which features do you want to achieve by using " or :LOC="All" "? If we check the "Allow Multiple values" option, we do not add any extra query. If we select "Select All" option for this parameter, it will return all the records.
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • MacBook Pro can't find my NAS (My Book World)

    I can't get my MacBook Pro to find my WD NAS (My Book World) on my home network. I have other devices that can find the NAS - Windows PCs and even an iTouch - so it is just my MacBook that can't find it. Anybody got any suggestions?

  • ILife '08 Gone?!

    I just got my MacBook Pro like on the 26th and it totally messed up or something, so I went to The Apple Store and had a Genius help me out. He told me that Leopard had to be reinstalled and he did it and now everything's working the way it's suppose

  • BPC (Outlooksoft) and SAP Solution Manager

    Has anyone seen the SAP Solution Manager used to rollout and/or upgrade Outlooksoft (now called BPC - Business Planning and Consolidation)? I am trying to assess the usefulness of this tool in an implementation where the only SAP module the company h

  • Receiving an error "Component Install failed" when reinstalling Adobe Cs3

    I had reformatted my hard drive and updated to Windows 7 without uninstalling or deactivating Adobe. So then when I tried to reinstall, it blocked me from activating. After doing an online chat with Adobe, they cleared up the activation block, but I

  • Where can I see the logs created for manual tests.

    HI, I have configured these in mtm.exe.config file. But i don't see any temp folder created in C:\ to see my logs. I am running manual tests using MTM2013. I have only test professional installed with Visual studio Shell Integrated. <system.diagnosti