我正在一个wpf应用程序上,我想将一个字符串列表(多个字符串值)传递给Crystal Report单个参数,以在Crystal Reports的第3节中显示多个值。我将参数的Allow Multiple values设置为True。 我用谷歌搜索,但找不到解决方法。
我已经尝试过了,但是它给出了一个异常“ System.ArgumentException:'无效的对象类型'。”
crystalReport obj2 = new crystalReport();
obj2.Load("@crystalReport.rpt");
foreach (string x in list)
{
obj2.ParameterFields["stringParameter"].CurrentValues.Add(x); //exception
}
我也尝试过这个。它给出了一个异常“ System.ArgumentException:'值不在预期范围内。'”
crystalReport obj2 = new crystalReport();
obj2.Load("@crystalReport.rpt");
obj2.SetParameterValue("stringParameter", list); // exception