Both of the Ext.Net examples that depict exporting data have there controls created in Markup.
I am creating my controls in behind code and ran into an error "The control with ID 'ChartStore' not found" when try to export the data. The charts look fantastic and everything works. I am just trying to add some additional features to the chart now.
Behind Code segment ...
...
Chart byMonthChart = new Chart();
byMonthChart.ID = "CrtsChart";
byMonthChart.ClientIDMode = ClientIDMode.Static;
...
...
Store store = new Store();
store.ID = "ChartStore";
store.ClientIDMode = ClientIDMode.Static;
store.SubmitData += new Store.AjaxSubmitDataEventHandler(ChartStore_Submit);
Model model = new Model();
...
store.Model.Add(model);
store.DataSource = theData;
store.DataBind();
byMonthChart.Store.Add(store);
.....
Markup ...
...
<HtmlBin>
<script type="text/javascript">
var exportData = function (format)
App.ExportFormatType.setValue(format);
var store = App.CrtsChart.store;
store.submitData(null, { isUpload: true});
}
</script>
</HtmlBin>
<ext:Hidden ID="ExportFormatType" runat="server" ClientIDMode="Static" />
...
<DockedItems>
...
<ext:Button runat="server" Tooltip="Export" Icon="PageExcel" >
<Listener>
<Click handler="exportData('xls');" />
</Listener>
</ext:Button>
...
</DockedItems>
...
This is also part of my Behind Code ...
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
...
BuildChart();
...
}
}
Is there something that I am obviously missing, or do I need to work up a scaled down example?