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
close icon

Grid export

Good Morning.

I'm using the grid control, it has 120 columns, I added the export buttons. When I export the file in excel, it only shows me about 10 or 11 columns.

Another problem with the control, since I have more than 100 columns and more than 3000 rows, the visibility of the data becomes somewhat slow.

Greetings and thank you

3 Replies

PS Pavithra Subramaniyam Syncfusion Team March 1, 2019 10:21 AM UTC

Hi Norberto, 

Thanks for contacting Syncfusion support. 

Query #1: I'm using the grid control, it has 120 columns, I added the export buttons. When I export the file in excel, it only shows me about 10 or 11 columns. 

We have prepared the sample with more than 120 columns. But unfortunately the reported issue was not reproduced at our end. So we have attached the prepared sample with this update for your reference and that can be download from the below link, 

 
If you are still facing the issue could you please provide the below detaila that will be helpful for us to provide a better solution as early as possible. 
 
  1. Share your Grid code example.
  2. Share your Syncfusion package version

Query #2: Another problem with the control, since I have more than 100 columns and more than 3000 rows, the visibility of the data becomes somewhat slow. 

We suggest to enable row and column virtualization in Grid to avoid this issue while rendering the large number of rows and columns in Grid. You can enable this in Grid by using enableVirtualization and enableColumnVirtualization property of the Grid. We already have the sample demo by using this virtual scrolling feature. In that sample we have loaded 100k records to the Grid. You can find that sample demo in the below link, 


Refer the below link to know about this properties, 


 
Please contact us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 



NO Norberto March 3, 2019 03:49 PM UTC

Thanks for your answer.

Removing Virtualization does not show me the data but it does export all the data.
I attach the code of my project.
 
Thanks


Attachment: Resultado_e2e0afaa.zip


PS Pavithra Subramaniyam Syncfusion Team March 5, 2019 05:39 AM UTC

Hi Norberto, 
 
We have analyzed the requirement. We suggest you to enable and disable the “enableColumnVirtualization” and “enableVirtualization” properties in the “ToolbarClick” and “ExcelExportComplete” events of Grid to achieve your requirement. Please refer the code example below, 
 
     
    @Html.EJS().Grid("Grid")...EnableColumnVirtualization().EnableVirtualization().Height("500").AllowExcelExport(true) 
    .Columns(col => 
    { 
        col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").Add(); 
        col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add(); 
        col.Field("EmployeeID").HeaderText("Customer Name").Width("150").Add(); 
        ... 
 
    }).Load("load").ExcelExportComplete("excelExportComplete").ToolbarClick("toolbarClick").Toolbar(new List<string>() { "ExcelExport" }).Render() 
 
    <script> 
        function toolbarClick(args) { 
            var gridObj = document.getElementById("Grid").ej2_instances[0]; 
            if (args.item.id === 'Grid_excelexport') { 
                //Disable virtualization before calling excel export method 
                gridObj.enableColumnVirtualization = false; 
                gridObj.enableVirtualization = false; 
                gridObj.excelExport(); 
            } 
        } 
        function excelExportComplete(args) { 
            //Enable the virtualization here 
            this.enableColumnVirtualization = true; 
            this.enableVirtualization = true; 
        } 
        ... 
    </script> 
 
 
Documentation :  
 
Please get back to us if you need further assistance. 
 
Regards, 
Pavithra S. 


Loader.
Live Chat Icon For mobile
Up arrow icon