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
No Data
Reply
  • 28464
    posted

    Hello Nicolas,

    Thanks for reporting the problem and for the detailed information. Looking at that, I really cannot see anything wrong and everything seems fine. Is the grid you have showing all the rows correctly in browser using the same binding?

    In any case, I am aware of one problem with exporting when AJAX is used. Are you using AJAX in any way - e.g. asp:UpdatePane, ig:WebAsyncRefreshPanel, the built-in grid load on demand mode - any other mode? Grid export is essentially a file download operation - file downloads are not compatible with ajax updates, so this may be the root of the problem.

    If this is the case, make sure that the control initiating the export is not ajaxified.

    If this does not help, any additional information on yoursetup could provide additional clues.

Children