BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
If you are using the WebAPI controller, then please refer to the below document for helpful information:
http://helpjs.syncfusion.com/js/grid/exporting
Regards,
Balaji Marimuthu
Hi Jim,
We have prepared an Exporting sample in OdataV4. Please refer to the sample and code example as below,
Sample: Exporting-Odata4
@(Html.EJ().Grid<object>("Editing") .Datasource(ds => { ds.URL("/odata/Orders").Adaptor(AdaptorType.ODataV4Adaptor); }) .ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.ExcelExport); items.AddTool(ToolBarItems.WordExport); items.AddTool(ToolBarItems.PdfExport); })) .Mappers(map => map.ExportToExcelAction("/odata/Orders/ExcelExport") .ExportToPdfAction("/odata/Orders/PdfExport").ExportToWordAction("/odata/Orders/WordExport")) .AllowPaging() .Columns(col => { col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width(50).Add(); col.Field("EmployeeID").HeaderText("Employee ID").Width(50).Add(); col.Field("ShipCity").HeaderText("ShipCity").Width(50).Add();
}) ) |
Also, Map the route in WebApiConfig to perform the Export Action as follows,
config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "odata/{controller}/{action}/{id}", //if you are using odata controller defaults: new { id = RouteParameter.Optional } );
// if you are using WebApi controller
config.Routes.MapHttpRoute( name: "DefaultActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } ); |
Query: #1 the call goes to a separate api. It is not a part of the solution I am working on, rather it is a separate project/solution. With that in mind, are you suggesting that the export requires its own separate rest call within that api?
Exporting doesn’t require own separate rest call within that API. You can use it as a separate project/solution and map the Exporting Action to Grid by using Mappers.
Please refer to the following code example,
@(Html.EJ().Grid<object>("Editing") . . .
.Mappers(map => map.ExportToExcelAction("/odata/Orders/ExcelExport") .ExportToPdfAction("/odata/Orders/PdfExport").ExportToWordAction("/odata/Orders/WordExport")) ) |
Query: #2 if so, does this mean the api requires the syncFusion dlls as well?
Yes, the Syncfusion dll’s are required to perform the Exporting Operation. Please refer to the Syncfusion dll in your Exporting project/solution.
Please refer to the dependencies for Exporting from the following link:
http://helpjs.syncfusion.com/js/dependencies
Please get back to us if you need any further assistance.
Regards,
Balaji Marimuthu