Crystal Report: display parameter values

Solved
lionel38 -  
DelNC Posted messages 2360 Status Member -
Hello,

I use Crystal Report 11.0.
When I use a parameter that can have multiple values (option "allow multiple values" set to yes) to run a query, I also put it in the report title to know which stores I selected (it's a query on inventory variances in an Oracle database for a GMAO CARL software).

However, if it works fine with a single store, it always shows only one store even when I select several.

Do you have any idea?

Thank you

lionel

5 answers

  1. Starluck
     
    Hi,

    You need to create a formula field. Here is the code I created:

    // declare & init local vars
    // result to return
    stringVar str := '';
    // index
    numberVar i;

    // processing
    for i := 1 to Count ({?selectEspece}) step 1 do (
    if (i > 1) then
    str := str + ',';
    str := str + {?selectEspece}[i];
    );

    // return result
    str;

    Hi,
    1
    1. criquet
       
      Thank you!
      0
    2. criquet
       
      Lionel to be exact!
      0
  2. Marion 03
     
    Hi Lionnel,

    I have the same problem as you and I wanted to know if you had found a solution.
    If that's the case, you would be very kind to share it with me!

    Thank you
    0
  3. lionel
     
    Well ... no, I haven't managed to figure out how to do it, despite making great progress in CR ...
    I can't list the items in the list.

    Best regards

    Lionel
    0
  4. tutosbi
     
    Just to complete Starluck's answer, CR stores the values provided by the user in an array that you iterate over to display them. This is why CR only shows the first element when you just drop the parameter field into your report.
    You can see a few tutorials at http://www.tutorielsbi.com

    Hope this helps...
    0
  5. DelNC Posted messages 2360 Status Member 2 010
     
    Hello

    I am a beginner with Crystal Reports and I have a problem that resembles yours.

    Here is my setup: I have a subreport in which I retrieve in the filter the dates entered by the user. I have 1-param (it's a formula field where I split the filter to get the start date) I have 2-param (it's a formula field where I split the filter to get the end date)

    In this subreport I have a table "releve". It has the columns id_releve, id_voiture, date_releve, releve_km

    My question is: can we, according to one param, retrieve the value releve_km?

    Thank you for the answer you provide.
    0