We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Export Excel function is not working

Hi,

I have followed exactly the documentation below in order to achieve the result of export excel function from the data grid. but it seems not working.


I have attached as well the screenshot of after clicking the export excel button. 

I purposely put the function of  "this.$refs.grid.excelExport();" before the "alert("Testing");".

The screenshot shows the result. It only display the alert message only however it has totally nothing is being downloaded yet I also checked
my console log as well, unfortunately nothing error appeared.

Could I have any instant assistance on this?

Thanks

Attachment: Dashboard_96d8b09.rar

1 Reply

PS Pavithra Subramaniyam Syncfusion Team November 11, 2019 07:01 AM UTC

Hi Chew Ann Kenn, 
 
Thanks for contacting Syncfusion support. 
 
For Excel Exporting the EJ2 Grid you need to enable the “grid.allowExcelExport” property as true. But in your code you have used this property inside the “grid. editSettings” which is not valid. So we suggest you to bind this property in Grid to achieve our requirement. Please refer to the below code example for more information. 
 
    <div id="app"> 
        <ejs-grid ref='grid' id='Grid' :dataSource='data' :toolbar='toolbarOptions' height='272px' :allowExcelExport='true' :toolbarClick='toolbarClick'> 
            <e-columns> 
                <e-column field='OrderID' headerText='Order ID' textAlign='Right' width=120></e-column> 
                <e-column field='CustomerID' headerText='Customer ID' width=150></e-column> 
                <e-column field='ShipCity' headerText='Ship City' width=150></e-column> 
                <e-column field='ShipName' headerText='Ship Name' width=150></e-column> 
            </e-columns> 
        </ejs-grid> 
    </div> 
</template> 
<script> 
 

Please get back to us, if you need further assistance. 
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon