Problem exporting grid with Sum

Hi there,

I'm having a problem when I try to Export a grid with sumarry row "Sum" and i don't know what's happening, some days ago it worked fine.

The following error is showing:


And those are my grid and export method:



Any idea what is happening?

Thanks.



3 Replies

SE Sathyanarayanamoorthy Eswararao Syncfusion Team March 8, 2018 12:46 PM UTC

Hi Neider, 

We have analyzed your query and we are unable to reproduce the mentioned issue with the provided code example. We have prepared a sample with the same code examples which can be found below. 


Refer the code example below. 

 
<ej-grid id="FlatGrid" datasource="ViewBag.datasource" allow-paging="true" allow-selection="false" allow-multiple-exporting="true" allow-sorting="true" allow-filtering="true"> 
     
    <e-sort-settings> 
        <e-sorted-columns> 
            <e-sorted-column field="CustomerID" direction="Ascending"></e-sorted-column> 
        </e-sorted-columns> 
    </e-sort-settings> 
    <e-columns> 
 
               ---------------------- 
 
        <e-column field="ShipCity" header-text="Ship City" width="110"></e-column> 
    </e-columns> 
    <e-summary-rows> 
        <e-summary-row title="Total"> 
            <e-summary-columns> 
                <e-summary-column summary-type="Sum" format="{0:N2}" display-column="Freight" datamember="Freight"></e-summary-column> 
                <e-summary-column summary-type="Sum" format="{0:N2}" display-column="EmployeeID" datamember="EmployeeID"></e-summary-column> 
            </e-summary-columns> 
        </e-summary-row> 
    </e-summary-rows> 
</ej-grid> 
 
[Controller.cs] 
 
public ActionResult ExportToExcel(string GridModel) 
        { 
            ExcelExport exp = new ExcelExport(); 
            var DataSource = ordersdata; 
            GridProperties gridProp = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel); 
            if (gridProp.SortedColumns.Count != 0) 
            { 
                gridProp.SortedColumns.Remove(gridProp.SortedColumns[0]); 
            } 
            if (gridProp.FilterSettings.FilteredColumns.Count != 0) 
            { 
                gridProp.FilterSettings.FilteredColumns.Clear(); 
            } 
            GridExcelExport excelExp = new GridExcelExport 
            { 
                FileName = "Export.xlsx", 
                Excelversion = ExcelVersion.Excel2010, 
                Theme = "flat-saffron" 
            }; 
            
            return exp.Export(gridProp, DataSource, excelExp); 
        } 

If you still face the issue please share the below details. 

  1. Complete code example of grid in view page and controller page.
  2. Screenshot or video of replication procedure of the issue.
  3. Syncfusion Essential studio versions.
  4. If possible try to reproduce the issue in the attached sample.

Regards, 
Sathyanarayanamoorthy 




NE Neider March 9, 2018 12:48 PM UTC

I realice that the problem is with the version of Newtonsoft.Json, it looks like Syncfusion isn't compatible with the last version of Newtonsoft.Json (11.0.1), because with 10.0.3 version works fine.

Thanks


SE Sathyanarayanamoorthy Eswararao Syncfusion Team March 9, 2018 04:36 PM UTC

Hi Neider, 

We are happy to hear that your issue has been resolved. 
If you need any further assistance please get back to us. 

Regards, 
Sathyanarayanamoorthy 


Loader.
Up arrow icon