Looping through a multiple value parameter array

前端 未结 3 1443
长情又很酷
长情又很酷 2021-01-13 11:06

I have a parameter that allows multiple values. Its for a name field in my database. What I want to be able to do is allow the user to put in a name and then have crystal fi

3条回答
  •  温柔的废话
    2021-01-13 11:40

    Create a multi-value parameter ({?Customer Name}) with these properties:

    • Default Value: ALL
    • All multiple values: TRUE

    Add a row to the parameter's pick-list grid; supply 'ALL' and 'ALL' (without single quotes)

    Create a Custom Function (named 'Delimit') with this text:

    // Delimit()
    // enclose each value in array in **, returning an array
    Function (Stringvar Array params)
    
      Split("*" + Join(params, "*,*") + "*", ",")
    

    Modify the report's record-selection formula:

    If {?Customer Name}<>"ALL" Then
        {TABLE.CUSTOMER_NAME} LIKE Delimit({?Customer Name})
    Else
        True
    

    Optionally, create a formula to display the parameter's values with this text:

    //{@Customer Name}
    Join( Delimit({?Customer Name}), ";")
    

提交回复
热议问题