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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export grid data without having to save it to a file first

Thread ID:





141866 Jan 8,2019 10:35 PM UTC Jan 10,2019 11:19 AM UTC React - EJ 2 1
Tags: Grid
Pat Buchanan
Asked On January 8, 2019 10:35 PM UTC

Good afternoon!  We are considering purchasing the product but are currently exploring its capabilities.  One of the items I have not been able to get to work is finding a way to export grid data and have it open immediately, without having to save it to the drive first.  The PDF opening up in the default PDF viewer, and the Excel file opening directly in Excel.

Is this possible?

Pavithra Subramaniyam [Syncfusion]
Replied On January 10, 2019 11:19 AM UTC

Hi Pat, 
Thanks for your interest in Syncfusion product. 
In Essential JavaScript 2, the PDF can be viewed in browser directly by saving PDF to the Blob and then using the blob data to open the PDF in new tab. In Grid Pdf Export you can get the blob data in the ‘pdfExportComplete’ event. Please refer to the below code example and sample link for more information. 
export class Exporting extends SampleBase { 
        pdfExpComplete = (args) => { 
            //This event will be triggered when pdf exporting. 
            args.promise.then((e) => { 
                //In this `then` function, we can get blob data through the arguments after promise resolved. 
                var blobURL = URL.createObjectURL(e.blobData); 
        toolbarClick(args) { 
            switch (args.item.text) { 
                case 'PDF Export': 
                    // pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) 
                   // if ‘isBlob’ is set as true then it will return blob data 
                    this.gridInstance.pdfExport(null, null, null, true); 
        render() { 
            return (<div className='control-pane'> 
                <div className='control-section'> 
                    <GridComponent dataSource={orderDetails} ref={grid => this.gridInstance = grid} toolbar={this.toolbarOptions} allowPaging={true} allowExcelExport={true} allowPdfExport={true} toolbarClick={this.toolbarClick.bind(this)} pdfExportComplete={this.pdfExpComplete.bind(this)}> 
                          .  .  . 
                        <Inject services={[Page, Toolbar, ExcelExport, PdfExport, Group]} /> 
    render(<Exporting />, document.getElementById('sample')); 
For Excel Exporting could you please share the details whether you want to view the file in MS Excel or any web viewer. This information will be helpful for us to provide a better solution as early as possible.  
Pavithra S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon