I want try this sub from
http://forums.infragistics.com/forums/t/19898.aspx
protected void ExportToExcel(object sender, EventArgs e) { Infragistics.Excel.Workbook workbook = new Infragistics.Excel.Workbook(); workbook.Worksheets.Add("Sheet1"); workbook.Worksheets.Add("Sheet2"); this.CopyPasteGrid1.DisplayLayout.ColHeadersVisibleDefault = ShowMarginInfo.No; this.UltraWebGridExcelExporter1.Export(this.CopyPasteGrid1, workbook); for (int i = 0; i < this.CopyPasteGrid1.Columns.Count; i++) { workbook.Worksheets[0].Columns[i].Width = 2000; } this.CopyPasteGrid2.DisplayLayout.ColHeadersVisibleDefault = ShowMarginInfo.No; workbook.ActiveWorksheet = workbook.Worksheets[1]; this.UltraWebGridExcelExporter1.Export(this.CopyPasteGrid2, workbook); for (int i = 0; i < this.CopyPasteGrid2.Columns.Count; i++) { workbook.Worksheets[1].Columns[i].Width = 2000; } workbook.ActiveWorksheet = workbook.Worksheets[0]; }
in VB.NET ..
but i have an error in :
Dim workbook As New Infragistics.Excel.Workbook
error says:
Workbook' is ambiguous in the namespace 'Infragistics.Excel' .
My Version:
<%@ Register assembly="Infragistics35.WebUI.UltraWebGrid.ExcelExport.v10.2, Version=10.2.20102.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid.ExcelExport" tagprefix="igtblexp" %>
I found this line in page in my project :
<%@ Register assembly="Infragistics35.Web.v10.1, Version=10.1.20101.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.EditorControls" tagprefix="ig" %>
That is the problem , Because I using v10.2 ..I delete it and code is running ...