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
990
Export Basic Grid to Excel Error
posted

I'm trying to follow the basic excel export example at: http://www.igniteui.com/grid/export-basic-grid

I've followed the sample exactly but when i try to export, i get the error as follows:
Uncaught ReferenceError: saveAs is not defined
(anonymous function) @ infragistics.gridexcelexporter.js:23
(anonymous function) @ infragistics.excel.js:26
(anonymous function) @ infragistics.documents.core.js:192
$c.p @ infragistics.documents.core.js:192
$c.w @ infragistics.documents.core.js:192
$c.d @ infragistics.documents.core.js:192
$c._save @ infragistics.excel.js:26
$c.save @ infragistics.excel.js:26
(anonymous function) @ infragistics.gridexcelexporter.js:23 

All i'm need to do is simply export the grid using this example.

I'm using IgniteUI 2015 Vol. 2 (15.2.20152.2081).

Is there a bug with this version?

thanks,

wvusaf

Parents Reply
  • 16310
    Offline posted in reply to Rob

    Hi,

    For setting properties - please see the ig.excel.DocumentProperties methods, which include properties that can be viewed by right-clicking the workbook's XLS file and viewing the properties. These include various tags that describe the content of the workbook such as the author, title, and subject of the workbook.

    However headers and footer are not document properties. Actually I am not quite sure what header and footer properties you mean. If you just want to style and format some row as a header or footer, then you will need to do this manually via the excel library. This would require inserting new row above the already available, or use any row via its index. A sample code that will give you an idea of the process:

    1) Writing values to cells in a given row:

        var row = worksheet.rows(rIndex);
        for (var cIndex = 0; cIndex < 5; cIndex++) {
            row.setCellValue(cIndex, "value");
        }

    2) You can then merge those cells into one that can act as a header.

    3) Setting formatting:

    var format = row.getCellFormat(0);
    format.fill($.ig.excel.CellFill.createLinearGradientFill(45, '#FF0000', '#00FFFF'));

    More details on using the javascript Excel library can be found at http://www.igniteui.com/help/javascript-excel-library-overview

    Please let me know if you would need further assistance on the matter.

Children