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
245
Does iggrid provide export to excel in angular 2.0 final version.
posted

I am trying to use igGridExcelExporter component in angular2.0 sample, but it not working. I want to export it with excel feature.

Parents Reply
  • 16310
    Offline posted in reply to Sameer Bagade

    Hi,

    The Angular 2 directives implemented for our IgniteUI toolset do not wrap the igGridExcelExporter component. However you can easily add this functionality by following the steps below. I applied them to our samples from https://github.com/IgniteUI/igniteui-angular2 and it worked fine:

    1) Add an exportExcel method (or however you name it) to your AppComponent:

    igniteui-angular2\samples\igGrid\app.ts

     exportExcel() {
      $.ig.GridExcelExporter.exportGrid($("#grid1"), {
            }); 
     }

    2) Add the following button in your App template:

    igniteui-angular2\samples\igGrid\IgGridTemplate.html

    <input type="button" value="Export" (click)="exportExcel()" class="btn btn-default"/>

    3) Add references to the js resources required for the exporting to work:

    igniteui-angular2\samples\igGrid\IgGrid.html

    <!-- 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>

    <script src="http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/modules/infragistics.documents.core.js"></script>
     <script src="http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/modules/infragistics.excel.js"></script>

    <script src="http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/modules/infragistics.gridexcelexporter.js"></script>

    I intentionally cited the exact fiels where to apply the steps, as you said you were following our samples from github. Please let me know if you have further questions on the matter, I will be glad to help.

Children