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
650
UltraGridExcelExporter for List<T>
posted

I have a List<MyClass> which is bound to a bindingsource and the grid to the datasource.

The grid's MaxBandDepth is set to 1 to only show MyClass values.

I have added the ExcelExporter to the form but when it goes through:

expExcelExporter.Export(ultraGrid1, Infragistics.Excel.WorkbookFormat.Excel97To2003);

Nothing happens.

Please help!

UPDATE: I just added a filename to it and looked in the directory and there it was! I thought it might open Excel or something.

  • 469350
    Verified Answer
    Offline posted

    The method call you list here seems to do nothing because this overload of the Export method exports the grid to a WorkBook. Since you are not storing the Workbook in a variable, nothing happens to it.

    If you use an overload of the Export method that takes a FileNamem it will save the workbook to a file.

    If you want to open that file in Excel - assuming Excel or some other Excel file reader is installed on the the machine, you could call Process.Start(fileName).