Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to pass multiple values to a parameter from .Net Application

Hello - I am customizing a .NET application ou tof box a third party tool. I have created a crystal 2008 report with a parameter for multiple values and it works from crystal report. I can pass discrete value as shown below, how can I make it to pass multiple values like, "ANSTG","TMTG",...

Dim paramValue As CrystalDecisions.Shared.ParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue()

paramValue.Value = "ANSTG"

crReportDocument.SetParameterValue("TG", paramValue)

When I Pass paramValu.Valu = "ANSTG","TMTG", report opens with no data.

what is the correct way of pasing multiple values?

Thanks for the help.

Former Member
Former Member replied

I just recently faced this issue. What you want to do is build a list of string (or int for numbers, or datetime for datetimes or whatever is your crystal parameter's data type). Populate the array, then pass it to the SetParameterValue() funciton. This is my code...pay no attention to my own internal structures. The interesting variable is string [] values

              string[] values = new string[(HdlParam.WpfUIParameterElements.First() as ListView).SelectedItems.Count];
              int i = 0;
              foreach (HdLParameterValueAndDescription HdLElem in (HdlParam.WpfUIParameterElements.First() as ListView).SelectedItems)
              {
                values<i> = HdLElem.Value.ToString();
                i++;
              }

              ReportCopy.SetParameterValue(HdlParam.crystalParamName, values);

I hope it helps

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question