- Home
- Forum
- ASP.NET Core
- Problem exporting grid with Sum
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.
SIGN IN To post a reply.
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.
Sample: http://www.syncfusion.com/downloads/support/directtrac/136296/ze/SyncfusionASPNETCore513592927.zip
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.
- Complete code example of grid in view page and controller page.
- Screenshot or video of replication procedure of the issue.
- Syncfusion Essential studio versions.
- 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
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
NE Neider
- Mar 7, 2018 06:48 PM UTC
- Mar 9, 2018 04:36 PM UTC