如何将值列表传递到水晶报表中 [英] How to pass a list of values into a crystal report
本文介绍了如何将值列表传递到水晶报表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个整数值列表(员工ID),我需要传递给Crystal Report。
我使用Action类来传递这些值。
到目前为止,我已成功传递单个值,但我找不到传递值列表的方法。
I have a list of integer values(employee IDs) which i need to pass to a Crystal Report. I am using a Action class to pass these values. So far i have succeeded with passing a single value but i couldn't 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);
通过这种方式,我可以将fromDate值输入Crystal Report。
有没有人知道如何获得这种列表
By this way i was able to get the fromDate value into the Crystal Report. Does any one know how to get a this kind of list
int employeeList[]
或者
String[] empListOptions
提前致谢。
推荐答案
foreach (string in string_array)
{
param.Value = string;
report.ParameterFields[parameter].CurrentValues.Add(param);
}
在此处找到: http://www.logicaltrinkets.com/wordpress/?p=227
这篇关于如何将值列表传递到水晶报表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文