have a standard grid
<ig:WebDataGrid ID="WeeklyGrid" runat="server" Width="1500px" />, rerurning 15 rows but when i do export to excel i just get column headerstried document exprter as well but same result
code : using this from infragistics samples only
Infragistics.Documents.Excel.WorkbookFormat excelFormat = Infragistics.Documents.Excel.WorkbookFormat.Excel97To2003;
Infragistics.Documents.Excel.Workbook wBook = new Infragistics.Documents.Excel.Workbook(excelFormat);
this.eExporter.Export(this.WeeklyGrid, wBook);
string tmpName = Server.MapPath("~/GridData.xls"); wBook.Save(tmpName);
Hello,
I will be happy to help you with this issue.
May I ask if you are binding the WebDataGrid in the codebehind? If so, I recommend rebinding the WebDataGrid across postback to prevent this behavior from occurring. Pleas note, because the WebExcelExporter obtains its data from the WebDataGrid, the WebDataGrid requires data across postbacks.
I have attached a sample that demonstrates what you are trying to achieve with the WebExcelExporter. Also, you may view the sample provided on our website to learn more:http://es.infragistics.com/products/aspnet/sample/excel-exporter/export-webdatagrid
Here are some documentation links you may find useful:http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=Web_WebDataGrid_WebDataGrid.htmlhttp://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=Web_WebExcelExporter.htmlPlease let me know if you have any questions regarding this matter.
thanks for replying, i am using a datatable to bind the grid. tried both autogenerated clms and also using boundcolumn, but still only clms. I even tried calling the oracle stored procedure from the export button click event and rebinding the datatable but i still headers only. i am using almost same code as in http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=Web_WebExcelExporter.html. only difference is the grid has autogenerated clms=true and DatasourceID in the aspx page. please help
I have attached a sample that demonstrates how you can bind the WebDataGrid to a DataTable and export the WebDataGrid data to Excel with the use of our WebExcelExporter control. In your previous post, you mentioned the setting of DataSourceID in the aspx page. If this is indeed the case, you won't shouldn't need to set the datasource on postback.
Please run the sample and let me know if you have any questions regarding my implementation.
I copied your button click code and tried, still only headers
aspx: <ig:WebDataGrid ID="WeeklyGrid" runat="server" width="1500px">
aspx.cs
protected void Button2_Click(object sender, EventArgs e) { DisplayData dd = new DisplayData(); weeklysummary = dd.getMetroweeklyDisplay(Convert.ToInt32(coboBatch.CurrentValue), Convert.ToInt32(cborevision.CurrentValue)); WeeklyGrid.DataSource = weeklysummary; WeeklyGrid.DataBind(); WeeklyGrid.Visible = true; Button3.Visible = true; // int z = WeeklyGrid.Columns.Count; }
protected void Button3_Click(object sender, EventArgs e) { DisplayData dd = new DisplayData(); Infragistics.Documents.Excel.WorkbookFormat excelFormat = Infragistics.Documents.Excel.WorkbookFormat.Excel97To2003;
}