Select multiple items from a list box as values for a parameter of crystal report and Oracle procedure

-  I have a  Product list box (asp.net) used as multiple selected values for  a parameter. 
- The Product ID is defined in the Oracle procedure as NUMBER data type. 
-  In my crystal report, I have a parameter field allow multiple values as p_product_id type as Number.  This is the code in my Record Selection Formula for the report:
({?p_product_id}[1] = -1 OR {Procedure_name.product_id} in {p_product_id})
-  In C#, this is my code
List<decimal?> productUnit = new List<decimal?>();
int counter = 0;
decimal prod;
for (int i = 0; i < lstProducts.Items.Count; i++)
              if (lstProducts.Items[i].Selected)
                            if (decimal.TryParse(lstProduct.Items[i].Value, out prod))
                                productUnit.Add((decimal?)prod);                              
                                counter++;
       if (counter == 0)
                   productUnit.Add(-1);                      
ReportingDAO rDataFactory = new ReportingDAO();
retVal = rDataFactory.GetProductReport(productUnit);
public CrystalDecisions.CrystalReports.Engine.ReportDocument GetProductReport(List<decimal?> productUnit)
          CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptProductDownload();
          ReportLogon rptLog = new ReportLogon();
         rptLog.Logon(retVal, "RPT_PRODUCT_DOWNLOAD");
         retVal.SetParameterValue("p_product_id", productUnit); 
I keep having the "Value does not fall within the expected range" when I debug.  My question is, is the data type I used for procedure/Crystal report/ and C# correct ?  I always have problem with the data type.  Any help would be
appreciated
Thank you

Hi progGirl,
Thank you for your post, but Microsoft doesn't provide support for CrystalReport now. Please post your question in SAP official site here:
http://forums.sdn.sap.com/forum.jspa?forumID=313
Thank you for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How can I select an item from a list component with a seperate button

    This is a repost, I decided it'd probably be better here than
    in the general discussion board. I will try to delete the other
    one.
    Hello Everyone,
    This is my first post here. I am trying to figure out how to
    select an item within a list component with a button. This button
    is calling a function. I have searched for the past 3 hours online
    and I can't find anything about it. I thought perhaps I could set
    the selectedItem parameter, but that is read only, and I believe it
    returns an object reference rather than something like a number so
    even if i could set it, it would be pointless. I also found a get
    focus button, thought that may lead me somewhere, but I think that
    is for setting which component has focus currently as far as typing
    in and things like that. I am lost.
    Basically I am looking for a way to type this
    myList.setSelected(5); where 5 is the 5th item in the list.
    Any help would be much appreciated.

    Never mind found it. It is the property called selectedIndex
    and it is writable

  • How to add a list box with values for a ztable in SM30

    Hello Gurus,
                    I had created a table maintenance for Ztable and added many extra functionality to that. Now i would like to add a list box or check table for a field. Can i do that with out Regenerating my table maintenance. Please help me its..very urgent.

    Have referred this domain to the data element, this should be the Field type in ur table for the particular field.
    Eg: <b>SE11 > table name > fields-ZTEST > fieldtype-ZZTEST</b>
    ZZTEST in the data element > create a domain for this data element and in that specify teh value range.
    Save and activate it.
    Make sure that u regenerate teh table maintenance generator else u cant see the changes.
    Now if u press F4 u can see only thevalues specified, also u will see only the list box with values in SM30.
    Try this,please let me know if u face any difficulties.

  • Removing Items from Populated List-Box

    I have a drop down box populate a list box. (change: ListBox1.addItem(xfa.event.newText)) But I can add more then one of the same selection so how do I remove them from the ListBox. Upon click? somehow? I don't konw the lingo.

    There is a selectedIndex property that will give you back the index of the 1st item that is selected.
    Paul

  • How to remove an item from a list box?

    Here's my previous code.
    I hope someone can help me. Thanks.
    public partial class frmJaialai : Form
    List<Jaialai> source;
    public frmJaialai()
    InitializeComponent();
    private void frmJaialai_Load(object sender, EventArgs e)
    source = new List<Jaialai>();
    private void btnAdd_Click(object sender, EventArgs e)
    if (IsValidData())
    int bet;
    if (string.IsNullOrEmpty(txtJaialaiNumber.Text) || !Int32.TryParse(txtBet.Text, out bet))
    MessageBox.Show("Must be a required field.", "Entry Error");
    return;
    var existingProduct = source.Where(x => x.JaialaiNumber == txtJaialaiNumber.Text).SingleOrDefault();
    if (existingProduct != null)
    existingProduct.Bet += bet;
    else
    source.Add(new Jaialai { Bet = bet, JaialaiNumber = txtJaialaiNumber.Text });
    lstJaialaiNumbersList.DataSource = null;
    lstJaialaiNumbersList.DataSource = source;
    txtJaialaiNumber.Text = "";
    // save the jai-alai numbers list on a txt file
    const string sPath = @"C:\Automated Jai-alai Program\Jai-alai Numbers List.txt";
    System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
    foreach (var item in lstJaialaiNumbersList.Items)
    SaveFile.WriteLine(item);
    SaveFile.Close();
    public class Jaialai
    public string JaialaiNumber { get; set; }
    public int Bet { get; set; }
    public override string ToString()
    return string.Format("{0} = {1}",
    JaialaiNumber, "₱" + Bet.ToString());
    private bool IsValidData()
    return Validator.IsPresent(txtJaialaiNumber) &&
    Validator.IsPresent(txtBet) &&
    Validator.IsInt32(txtBet);

    Hi ,
    Here is a sample about remove Item from listBox.
    // listBox1.Items.Clear();// remove all
    int SelItemCount = listBox1.SelectedItems.Count;
    for (int i = 0; i < SelItemCount; i++)
    listBox1.Items.Remove(listBox1.SelectedItem);//remove which one you selected
    You also can check in MSDN
    https://msdn.microsoft.com/en-us/library/aa983551(v=vs.71).aspx
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Selecting Items From a List Box No Longer Works in Powershell Version 3.0

    I've noticed that the script in
    this powershell tip of the week no longer seems to fully work in Powershell V3. The selection dialog will pop up as expected, with all of the elments populated, but the selection is not stored in variable '$x'. Any idea what changed and how to get it to
    work?
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
    $objForm = New-Object System.Windows.Forms.Form
    $objForm.Text = "Select a Computer"
    $objForm.Size = New-Object System.Drawing.Size(300,200)
    $objForm.StartPosition = "CenterScreen"
    $objForm.KeyPreview = $True
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter")
    {$x=$objListBox.SelectedItem;$objForm.Close()}})
    $objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape")
    {$objForm.Close()}})
    $OKButton = New-Object System.Windows.Forms.Button
    $OKButton.Location = New-Object System.Drawing.Size(75,120)
    $OKButton.Size = New-Object System.Drawing.Size(75,23)
    $OKButton.Text = "OK"
    $OKButton.Add_Click({$x=$objListBox.SelectedItem;$objForm.Close()})
    $objForm.Controls.Add($OKButton)
    $CancelButton = New-Object System.Windows.Forms.Button
    $CancelButton.Location = New-Object System.Drawing.Size(150,120)
    $CancelButton.Size = New-Object System.Drawing.Size(75,23)
    $CancelButton.Text = "Cancel"
    $CancelButton.Add_Click({$objForm.Close()})
    $objForm.Controls.Add($CancelButton)
    $objLabel = New-Object System.Windows.Forms.Label
    $objLabel.Location = New-Object System.Drawing.Size(10,20)
    $objLabel.Size = New-Object System.Drawing.Size(280,20)
    $objLabel.Text = "Please select a computer:"
    $objForm.Controls.Add($objLabel)
    $objListBox = New-Object System.Windows.Forms.ListBox
    $objListBox.Location = New-Object System.Drawing.Size(10,40)
    $objListBox.Size = New-Object System.Drawing.Size(260,20)
    $objListBox.Height = 80
    [void] $objListBox.Items.Add("atl-dc-001")
    [void] $objListBox.Items.Add("atl-dc-002")
    [void] $objListBox.Items.Add("atl-dc-003")
    [void] $objListBox.Items.Add("atl-dc-004")
    [void] $objListBox.Items.Add("atl-dc-005")
    [void] $objListBox.Items.Add("atl-dc-006")
    [void] $objListBox.Items.Add("atl-dc-007")
    $objForm.Controls.Add($objListBox)
    $objForm.Topmost = $True
    $objForm.Add_Shown({$objForm.Activate()})
    [void] $objForm.ShowDialog()
    $x

    Hi,
    What is the value of $x?
    Make sure that you have copied the whole script, and whether it works on Powershell V2?
    Regards,
    Yan Li
    TechNet Subscriber Support
    If you are
    TechNet Subscription
    user and have any feedback on our support quality, please send your feedback
    here.
    Cataleya Li
    TechNet Community Support

  • How do i select multiple items in spark list without pressing the control ?

    Hi all,
    I need to change the list behavioral to enable multiple selections with a click on each item
    In list, instead of using the control
    10x
    elazar r

    In your itemClick handler, check the selectedItems property, and add to it. You might need to maintain a separate collection object and bind the selectedItems property to it.
    The question becomes how to unselect an item. If it is already selected, clicking it again can unselect it, and clicking a submit button or comparable action could do the same.
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • Selecting multiple items from an ISelectionList

    I'm writing a jsp that iterates through all content items in a folder, extract certain properties from the content items and display them to the user. One of the property is a multi-valued selection list.
    Here's a snapshot of the code:
    IContentFactory contentFactory = remoteSession.getContentFactory();
    IFolderManager folderManager = contentFactory.getFolderManager();
    IContentItemManager contentItemManager = contentFactory.getContentItemManager();
    IFolder desiredFolder = folderManager.getFolderByPath("/path to folder");
    IContentItem [] contentItems = contentItemManager.getContentItems(desiredFolder);
    for(int i=0;i<contentItems.length;i++) {
    IContentItem contentItem = contentItems;
    String multiValuedSelectionList = contentItem.getSelectionListPropertyValue(contentItem.getProperty("multiValuedSelectionList"));
    The problem is, the method getSelectionListPropertyValue in IContentItem only returns the first value of the multi-valued selection list.
    Is there a way I can retrieve all the values? I can do it quite easily in Publisher's presentation template but there seems to be no obvious way for me to do it via the IDK.
    Would appreciate some help from any IDK gurus out there .
    Thanks.

    Hello,
    You are currently experiencing Bug 7804355, where the getSelectionListPropertyValue in IContentItem returns only the first selection, even if the selection list property has multiselect option (and several items selected). No other means using the Publisher PRC API are available to get the needed information about all selections.
    A workaround is to directly query the Publisher database for the selections. I can't help you create the database connection code, but I can give you a query that will return the values. As long as your custom application is not overloading the database with queries, this should be harmless.
    SELECT *
    FROM PCSENUMSELECTED AS es INNER JOIN
    PCSDIRECTORY AS dir ON es.ITEMID = dir.DIRECTORYID INNER
    JOIN
    PCSENUMENTRIES AS ent ON es.ENTRYID = ent.ENTRYID
    WHERE (es.PROPERTYID = 24035) AND (es.ITEMID = 42028)
    For this example, my property ID is 24035 and the content item is 42028. The selected values of the property are in the ENTRYVALUE column.
    You should open up a ticket with support, mention the bug number and let them know that you understand it's a bug and that there is no solution at this time. They can associate your case with the bug and which gives the bug a higher priority for a future fix.

  • Selecting multiple records from the list and append it into internal table.

    hi
    there is a list of 10 records in the output screen with check boxes. if the user select any 3 records then those records should get appended in some other internal table of same structure.
    this is the requirement. can anybody help me it is very urgent.
    regards
    sami

    Hi,
    Loop at the internal table which contains the value in table control and move it to a work area. apend the work area to the next internal table. Like:
    loop at it1 into wa1 where sel = 'X'.
    append wa1 to it2.
    endloop.
    or
    loop at it1 into wa1.
    if wa1-sel = 'X'.
    append wa1 to it2.
    endif.
    endloop.
    Regards,
    RM

  • How to select multiple items when on safari?  Ex: when I have to choose countries where I have worked from a list.

    Hi Everyone
    Please advise: how do I select multiple items when on Safari? Ex. when I have to select multiple countries where I have worked.

    Hi Carolyn
    I am trying to select multiple items from a list on a particular website. I tried using the 'command' button, but to no avail.
    Grateful for any advice.

  • Missing "Select Multiple Items" in Report Filter for Pivot Table in Excel Services

    I have a Pivot Table with a Report Filter in Excel 2013.
    When I click the Report Filter in Excel , I get the check-box option to "Select Multiple Items".
    But , when the same Report.xls is published to SharePoint 2013 Excel Services,
    the check-box-option is missing ! and the default is "Multi-select", and there is no way to disable or toggle Multi-select
    is there any fix ?
    thanks

    Thank you Naveen, I have already read this , and checked ,
    But, it does not fix my issue :(
    All my desktops are set at 100%.
    All my List Items show as Check-boxes, ok.
    The problem is: that check-box option "Select Multiple Items" , just above the OK button, is missing when I run the report in Excel Services.
    So I have no way to toggle Select Single Items only.
    But when I Open this same report in Excel, everything works well.
    Is there any Fix for Excel Service /Sharepoint 2013.
    Paul

  • Display all valid items and select multiple items

    Let us say I have valid items in table. For each purchase user can select few items from the list. I have to display all valid items from table and user should able to check items to buy. What is the best way we can implement this in forms.
    Thanks, lalitha

    For all the valid items you can create LOV as i understood then user can choose what he wants. But this sentence ti still confusing to me. Or what is the tricky things in you scanerio if only you have to show the valid item then use LOV.
    Lalitk wrote:
    and user should able to check items to buy.-Ammad

  • Crystal Reports and values list of BEx variables

    Hello.
    I read this - http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsandBWquery+elements
    And there are writed in wiki:
    "List of values for SAP variables are created automatically by Crystal Reports only when you use SAP Toolbar to create the report:
    The list of values for a variable in Crystal Reports will be static, but the list will be always dymanic in InfoView as long as you use BW Publisher (save reports to BW, publish to BOE)and you logon to BOE using SAP Authentication."
    I have two link to BEx queries from my CR report - and my variables have not values. I think that I don't use "SAP" menu when created the report.
    But... what I can doing now? Is way transform "simple" report into "SAP" report?
    May be is way create "SAP" report and after it copy all content of old report into new "SAP" report including all objects, formats, formulas, connections?
    May be is way load values list from BEx query with "simple" reports?
    And another question - I see that in list I get texts and codes but showing only texts in run-time. Can I tune CR for show codes too?

    Post to Integration Kit SAP forum

  • How to passing multiple values for a parameter of discoverer(url parameters

    Hi All,
    I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
    'jeff,mark'
    'sfophiee,angela'
    Thanks and Regards
    Venkat

    Hello Venkat,
    I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
    OracleAS Discoverer 10.1.2.2 is installed with the following patch :
    Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
    So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
    Hope this helps, otherwise feel free to log a Service Request to Support.
    Best Regards,
    Gianluca

  • Getting multiple values from a list box

    Hi,
    I am not able to get multiple selected values from a list box using the getParameterValues(). I used the following code..
    String[] names=request.getParameterValues("lname");
    can anyone tell me what the error is or is there any other way i can get multiple selected values from a list box.
    Thanks
    Satish

    Fragment 1
    This is the JSP Code am using for testing
    <%
    String[] name =request.getParameterValues("D1");
    if(name.length==1)
    String value=name[0];
    Instead of name.lenght==1 try with name!=null
    Fragment 2
    out.println(value);
    replace the above fragment with
    %>
       <%-- print result -->
       <%=name[0]%>
    <%
    Fragment 3
    else
    %>
    The list box D1 is a multiple select list box.
    If it still doesn't work, check that the checkboxes have the same name as well as different values
    <input type="checkbox" name="D1" value="1">
    <input type="checkbox" name="D1" value="2">I hope this helps :-)
    Good luck
    touco
    ps: i want duke

Maybe you are looking for