【发布时间】:2014-05-23 17:38:22
【问题描述】:
下面是我的 C# 代码,用于从列表框中填充多选项目
List<string> listCountry = new List<string>();
for (int i = 0; i < lstCountry.Items.Count; i++)
{
if (lstCountry.Items[i]Selected)
{
countries = listCountry.Add(lstCountry.Items[i].ToString());
}
}
而且我有一行调用上述参数运行报表的方法:
retVal = CR.GetReport(Company, countries);
我的问题是:我应该为 countries 定义什么数据类型,因为当我将国家定义为 字符串国家=空; 我在这里做错了什么?请帮忙,非常感谢
对不起,我说的不够清楚,我还有另一个函数 GetReport() 定义为
public CrystalDecisions.CrystalReports.Engine.ReportDocument GetReport( string Company, string countries)
{
CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptReortData();
ReportLogon rptLog = new ReportLogon();
rptLog.logon(retVal, "Report");
retVal.SetParameterValue("P_Country", new string[] { country});
}
如何从分配给国家的列表框中获取值
【问题讨论】: