How to pass a list of values ​​to a crystal report

I have a list of integer values ​​(employee IDs) that I need to pass to Crystal Report. I use the Action class to pass these values. So far, I have managed to pass a single value, but I have not been able to find a way to pass a list of values.

Fields fields = new Fields(); Values vals1 = new Values(); ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue(); pfield1.setName("fromDate"); pfieldDV1.setValue(start_Date); vals1.add(pfieldDV1); pfield1.setCurrentValues(vals1); fields.add(pfield1); CrystalReportViewer viewer = new CrystalReportViewer(); //some code to set CrystalReportViewer settings viewer.setParameterFields(fields); 

That way, I was able to get the fromDate value in Crystal Report. Does anyone know how to get such a list

 int employeeList[] 

Or a

 String[] empListOptions 

Thanks in advance.

0
source share
1 answer
  foreach (string in string_array) { param.Value = string; report.ParameterFields[parameter].CurrentValues.Add(param); } 

Found here: http://www.logicaltrinkets.com/wordpress/?p=227

+1
source

Source: https://habr.com/ru/post/1013910/


All Articles