Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
950
Export to excel - No data!!!
posted

Hi,

I am trying to export my grid to excel. I am using the following code:
HTML

<igtbl:UltraWebGrid ID="mainGrid" runat="server" Width="100%" OnInitializeDataSource="mainGrid_InitializeDataSource"
OnInitializeLayout="mainGrid_InitializeLayout" Height="100%"><Bands><igtbl:UltraGridBand><AddNewRow View="NotSet" Visible="No">
</AddNewRow></igtbl:UltraGridBand></Bands><DisplayLayout Name="mainGrid" RowHeightDefault="20px" AllowColSizingDefault="Free" AllowSortingDefault="OnClient" HeaderClickActionDefault="SortMulti" RowSizingDefault="Free" SelectTypeRowDefault="Extended" ViewType="OutlookGroupBy"><FrameStyle Width="100%" Height="100%"></FrameStyle><FilterOptionsDefault AllowRowFiltering="OnClient" FilterUIType="FilterRow"></FilterOptionsDefault><ActivationObject BorderColor="" BorderWidth=""></ActivationObject></DisplayLayout></igtbl:UltraWebGrid>

<igtblexp:UltraWebGridExcelExporter ID="UltraWebGridExcelExporter1" runat="server" ExportMode="Download" DownloadName="test1.xls"></igtblexp:UltraWebGridExcelExporter>
<asp:Button runat="Server" ID="ExportToExcelButton" Text="Export to Excel" OnClick="ExportToExcel" />

CODE BEHIND
I have tried different codes:

1)
Infragistics.Excel.Workbook workbook = new Infragistics.Excel.Workbook();
workbook.Worksheets.Add(
"Sheet1");
this.UltraWebGridExcelExporter1.Export(this.mainGrid, workbook);

2)
mainGrid.DataBind();
UltraWebGridExcelExporter1.Export(mainGrid);


No results with either code.
Please help!

Regards,

Nicolas

Parents Reply Children
No Data