I have dynamic List boxes in my asp page. and I need to select the items from each list boxes for the below ex. selected item
[Date].[Calendar Date].[Calendar Year].&[2002] from one list box
[Date].[Calendar Date].[Calendar Semester].&[2002]&[2] from another list box
[Date].[Calendar Date].[Calendar Quarter].&[2001]&[4] from another etc....
I need to bring those above selected items as below
FROM ( SELECT {
[Date].[Calendar Date].[Calendar Year].&[2002]
} ON COLUMNS
FROM ( SELECT {
[Date].[Calendar Date].[Calendar Semester].&[2002]&[2]
} ON COLUMNS
FROM ( SELECT {
[Date].[Calendar Date].[Calendar Quarter].&[2001]&[4]
} ON COLUMNS
below code that i used to do this but no Luck :)
protected void imgRunReport_Click(object sender, ImageClickEventArgs e)
{
Panel tt = Cache["tt"] as Panel;
string mdxqry;
isRefresh = true;
string Cubename = ddlCubeList.SelectedItem.Value;
Dictionary<string, string> selectedfil = new Dictionary<string, string>();
foreach (ListBox ctl in tt.Controls.OfType<ListBox>())
{
string strSelectedFilters = string.Empty;
selectedfil.Remove(ctl.Text);
foreach (ListItem li in ctl.Items)
{
if (li.Selected)
selectedfil.Add(li.Text, li.Value);
}
strSelectedFilters = "FROM ( SELECT { " + string.Join("," , new List<string>(selectedfil.Values).ToArray()) + "}" + " ON COLUMNS ";
}
}
Remember: these values comes from dynamic listboxes
thanks In advance