Below is my C# code to populate the multi-selected items from the listbox
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());
}
}
And I have a line to call the method to run the report with the above parameters:
retVal = CR.GetReport(Company, countries);
My question is : What data type should I define for countries since it keeps giving me error like "can't implicitly convert type 'void' to 'string'" when I define countries as string countries = null; What did I do wrong here? Please help, thank you very much
Sorry I didn't make it clear enough, I have another the function GetReport() which is defined as
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});
}
How do I get the value from the listbox assign to countries