I finaly got sometihng useful written on some forum about passing multiple values to ONE parameter on report:
"In Crystal Reports, multiple-value and ranged-value parameters do not display all values entered into the parameter when the parameter is placed on a report. This occurs regardless of whether the parameter includes multiple discrete values, range values, or a combination of the two."
"To display all entries in a multiple-value parameter, create a formula to extract the parameter values and then concatenate them into a string."

So that means I can create just one formula field and put inside the formula which will get all the values and convert them to string.
I was thinking something of:

if UBound ({?Data}) = 1 then {?Data}[1]
else if UBound ({?Data}) = 2 then {?Data}[2]
else if UBound ({?Data}) = 3 then {?Data}[3]

Else if its not a good option, becuase it will look only one if. I need something else.
But it is showing only the 1st value always. I know you were saying I can create as many formula fields as many values I have, but by my logic, there can be only one as well. I just need the correct formula. Don`t you thing?

But even if I need to have 3 formula fileds in this my example would be ok, just it does not work jet correctly.

Shouldnt I use the "join"?

Would someone please help me some more with this issue? I can not figure it out by my self.
Please.

I am back to my old problem... with passing multiple values into one parameter.
I still haven`t figured it out how to do the correct code for formula field.
How to do the formula in case if I have "n" values to pass to parameter?

I would really appreciate some help. I am really struggling now. please
Mitja

ParameterFields paramFields = new ParameterFields(); 
      ParameterField pfItem = new ParameterField();
      pfItem.ParameterFieldName = "myParam"; //my parameter name which I created
      ParameterDiscreteValue dcItem;

      foreach (DataRow dr in PodatkiIzBlagajne.Rows)
      {
        dcItem = new ParameterDiscreteValue();
        dcItem.Value = dr[0].ToString();
        pfItem.CurrentValues.Add(dcItem);
        paramFields.Add(pfItem);
      }

The problem I see here is that there is no connection with the myParam and this code. How to connect it?

The only way when connection works is when I pass only 1 value like:

CrystalReport cr = new CrystalReport();

cr.SetParameterValue("myParam", myValue); //myValue is a string

But I would like to pass more then just one values to only one poarameter. So how to establish a connection between the parameter and the values?

Please!

** THIS WORK'S FINE ON VS 2010 CR 13_0_2**

        ReportDocument report = new ReportDocument();
        report.Load("rptLicenciranje.rpt");

        report.SetParameterValue("firma", firma);
        report.SetParameterValue("program", program);
        report.SetParameterValue("verzija", verzija);
        report.SetParameterValue("pid", pid);
        report.SetParameterValue("hid", hid);

        frmIspis Ispis = new frmIspis();
        Ispis.Show();
        Ispis.repViewer.ReportSource = report;
        Ispis.repViewer.Refresh();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.