hi Members,
I have an ajax tab container with different tabs and inside different tabs, there are many different charts. (Please see here:
http://i.stack.imgur.com/3zdox.png[
^]).
Does anyone know how can I export these charts from different tabs into
same excel workbook but
different excel spreadsheets? For e.g. 1 tab=1 excel spreadsheet, 2 tabs = 2 different excel spreadsheets and etc. This is the output I want to achieve (Please see here:
http://i.stack.imgur.com/M50R5.png[
^]).
Have tried research online but can't find anything useful, all were how to export gridviews to excel.
This is my codes:
//Aspx file
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
BindChart();
}
public void BindChart()
{
AjaxControlToolkit.TabContainer container = new AjaxControlToolkit.TabContainer();
container.ID = "TabContainer";
container.EnableViewState = false;
container.Tabs.Clear();
container.Height = Unit.Pixel(1000);
container.Width = Unit.Percentage(100);
if (Listbox1.SelectedValue == "Select All")
{
foreach (ListItem item in Listbox1.Items)
{
if (item.Text == "Select All")
{
continue;
}
AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
panel.HeaderText += item.Text;
container.Tabs.Add(panel);
Label tabContent = new Label();
tabContent.ID += item.Text;
tabContent.Text += item.Text;
Chart Chart1 = new Chart();
Chart1.DataSource = dt;
Chart1.Width = 800;
Chart1.Height = 500;
Chart1.Series.Add(new Series());
Chart1.Series[0].ChartType = SeriesChartType.BoxPlot;
List<object> List_CHART = dt.AsEnumerable().ToList<object>();
foreach (DataRow row in dt.Rows)
{
Chart1.Series[0].Points.AddXY(row["TITLE"], new object[] { row["MIN"], row["MAX"], row["25TH_PERCENTILE"], row["75TH_PERCENTILE"], row["50TH_PERCENTILE"], row["AVG"] });
}
ChartArea ca= new ChartArea();
ca.AxisX = new Axis();
ca.AxisY = new Axis();
Chart1.ChartAreas.Add(ca);
Chart1.DataBind();
Chart1.Visible = true;
panel.Controls.Add(Chart1);
}
}
PlaceHolder1.Controls.Add(container);
}
public AjaxControlToolkit.TabPanel GetManualTab()
{
AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
return panel;
}
protected void EXPORT_BUTTON_Click(object sender, EventArgs e)
{
}
Question: how to export many charts from different tabs into
same excel workbook but
different excel spreadsheets. For e.g. 1 tab=1 excel spreadsheet, 2 tabs = 2 different excel spreadsheets and so on (depending on how many tabs there are from ajax tab container).
Appreciate if someone can provide me help on this, thanks.