The Gridview to Excel Export Tool 2.0 - Demo Site
How to choose columns to export
Welcome
Home
GEET Easiest
GEET Standard
GEET Easy
Multi-sheets Workbooks
More
GEET Home
Easier
Standard
How to select which column to export
How to set httpCacheAbility in Response
Easy Class from objectDatasource
License Data
09/09/2010 6.45.00
back
By means of the
GEETEasy Classes
of the Gridview to Excel Export Tool you can export data to Excel
with just two lines of code
.
By means of
GEETEasy Classes
of the Gridview to Excel export Tool you can export data to Excel
with just two lines of code
.
Available columns
Selected columns
VendorID
AccountNumber
Name
CreditRating
PreferredVendorStatus
ActiveFlag
PurchasingWebServiceURL
ModifiedDate
Select columns to export and press any Export Button tu run the export.
What does this page demonstrate?
You can export to Excel from a Sqldatasource
You can select which columns to export
C# code to export data from selected columns to xlsx format:
protected void ExportToExcel(ExcelOutputFormat exportformat) { if (ListBoxColumns2.Items.Count == 0) { LbErrore.Text = "No columns selected. Please select columns to export and retry."; return; } Page p = this.Page; // instantiating the class for the export to xml format GEETStandard geetStandard = new GEETStandard(exportformat, User.Identity.Name, ref p); // create a new Excel Sheet definition ExcelSheet exs = new ExcelSheet("My Export", "Just Selected Columns"); foreach (ListItem li in ListBoxColumns2.Items) { // creating a new column for each column selected ExcelColumn ec = new ExcelColumn(); // setting the column header ec.ColumnHeader = li.Text; // setting the column field where to get data from ec.FieldName = li.Text; // setting the column type ec.ColumnType = ColumnTypes.String; // adding the column to the Excel sheet definition exs.ColumnsList.AddLast(ec); } // setting the data source for the Excel sheet exs.SDS = this.MySqlDataSource; // adding the excel sheet to the Excel Workbook geetStandard.GEETExcelWorkbookDefinition.ExcelSheets.Add(exs); // run the export geetStandard.Execute(); this.LbMessaggio.Text = geetStandard.GEETMessage; if (!geetStandard.GEETOk) { this.Log.Text = geetStandard.GEETLog; } }
Ask info
Click here to buy the Gridview to Excel Export Tool
Free Download
Ing Ettore CefalĂ - via Conca del Naviglio,5 - 20123 - Milano - P.IVA: 07902170153