ig.GridExcelExporter

ig.GridExcelExporter_image
The igGridExcelExporter allows you to export the igGrid, igTreeGrid and igHierarchicalGrid control to Excel with different settings and features specified by the developer. The igGridExcelExporter supports the igGrid Filtering, Hiding, Paging, Sorting, Summaries, ColumnFixing and Virtualization features. It exposes a rich client-side API to work with, in order to interact with the workbook that being produced throughout the export process. The igGridExcelExporter supports Infragistics themes.

Code Sample

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>GridExcelExporter</title>
     
    <!-- Infragistics Combined CSS -->
    <link href="css/themes/infragistics/infragistics.theme.css" rel="stylesheet" type="text/css" />
    <link href="css/structure/infragistics.css" rel="stylesheet" type="text/css" />
     
    <!-- jQuery Core and jQuery UI -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
 
    <!-- Infragistics Combined Scripts -->
    <script src="js/infragistics.core.js" type="text/javascript"></script>
    <script src="js/infragistics.lob.js" type="text/javascript"></script>
     
    <!-- Required for igGridExcelExporter -->
      <script type="text/javascript" src="/js/modules/infragistics.documents.core.js"></script>
      <script type="text/javascript" src="/js/modules/infragistics.excel.js"></script>
      <script type="text/javascript" src="/js/modules/infragistics.gridexcelexporter.js"></script>
     
    <!-- External files for exporting -->
    <script src="http://www.igniteui.com/js/external/FileSaver.js"></script>
    <script src="http://www.igniteui.com/js/external/Blob.js"></script>
 
  </head>
  <body>
    <table id="grid"></table>
    <script type="text/javascript">
      $(function () {
        $("#grid").igGrid({
          columns: [
            { key: "ProductID", headerText: "Product ID" },
            { key: "Name", headerText: "Name" },
            { key: "ProductNumber", headerText: "Product number" },
            { key: "SafetyStockLevel", headerText: "Safety stock level" }
          ],
          autoGenerateColumns: false,
          primaryKey: "ProductID",
          dataSource: [
            { "ProductID": 1, "Name": "Adjustable Race", "ProductNumber": "AR-5381", "SafetyStockLevel": 1000 },
            { "ProductID": 2, "Name": "Bearing Ball", "ProductNumber": "BA-8327", "SafetyStockLevel": 1000 },
            { "ProductID": 3, "Name": "BB Ball Bearing", "ProductNumber": "BE-2349", "SafetyStockLevel": 800 },
            { "ProductID": 4, "Name": "Headset Ball Bearings", "ProductNumber": "BE-2908", "SafetyStockLevel": 800 },
            { "ProductID": 316, "Name": "Blade", "ProductNumber": "BL-2036", "SafetyStockLevel": 800 },
            { "ProductID": 317, "Name": "LL Crankarm", "ProductNumber": "CA-5965", "SafetyStockLevel": 500 },
            { "ProductID": 318, "Name": "ML Crankarm", "ProductNumber": "CA-6738", "SafetyStockLevel": 500 },
            { "ProductID": 319, "Name": "HL Crankarm", "ProductNumber": "CA-7457", "SafetyStockLevel": 500 },
            { "ProductID": 320, "Name": "Chainring Bolts", "ProductNumber": "CB-2903", "SafetyStockLevel": 1000 },
            { "ProductID": 321, "Name": "Chainring Nut", "ProductNumber": "CN-6137", "SafetyStockLevel": 1000 }
          ],
          width: "500px",
        });
 
        $.ig.GridExcelExporter.exportGrid($("#grid") {
          fileName: "igGrid"
        });
      })
    </script>
  </body>
</html>

Related Samples

Related Topics

Dependencies

jquery-1.4.4.js
jquery.ui.core.js
jquery.ui.widget.js
filesaver.js
infragistics.ui.grid.framework.js
infragistics.ui.grid.columnfixing.js
infragistics.ui.grid.filtering.js
infragistics.ui.grid.hiding.js
infragistics.ui.grid.paging.js
infragistics.ui.grid.sorting.js
infragistics.ui.grid.summaries.js
infragistics.excel.js

Copyright © 1996 - 2025 Infragistics, Inc. All rights reserved.

#