Error in Export to Excel
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>Type 'System.String' is not supported for deserialization of an array.</ExceptionMessage>
<ExceptionType>System.InvalidOperationException</ExceptionType>
<StackTrace>
at System.Web.Script.Serialization.ObjectConverter.ConvertListToObject(IList list, Type type, JavaScriptSerializer serializer, Boolean throwOnError, IList& convertedList)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object propertyValue, Object o, String memberName, JavaScriptSerializer serializer, Boolean throwOnError)
at System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.AddItemToList(IList oldList, IList newList, Type elementType, JavaScriptSerializer serializer, Boolean throwOnError)
at System.Web.Script.Serialization.ObjectConverter.ConvertListToObject(IList list, Type type, JavaScriptSerializer serializer, Boolean throwOnError, IList& convertedList)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToType(Object o, Type type, JavaScriptSerializer serializer)
at Northwind.JSGridExportController.ConvertGridObject(String gridProperty) in f:\Product\BetaExportingServices\Northwind\JSGridExportController.cs:line 72
at Northwind.JSGridExportController.ExcelExport() in f:\Product\BetaExportingServices\Northwind\JSGridExportController.cs:line 30
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClassf.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
</StackTrace>
</Error>
And here is the form that was sent:
<form action="http://js.syncfusion.com/ExportingServices/api/JSGridExport/PdfExport" method="post"><input name="GridModel" type="hidden" value='{"allowPaging":true,"showColumnChooser":false,"allowSorting":true,"showStackedHeader":false,"selectedRecords":[],"stackedHeaderRows":[],"allowMultipleExporting":false,"allowFiltering":false,"allowSelection":true,"allowGrouping":false,"showSummary":false,"allowResizing":true,"allowResizeToFit":true,"allowTextWrap":false,"allowCellMerging":false,"enablePersistence":false,"selectedRowIndex":-1,"allowSearching":false,"allowReordering":false,"enableTouch":false,"locale":"en-US","allowMultiSorting":false,"exportToExcelAction":"","exportToWordAction":"","exportToPdfAction":"","selectionSettings":{"selectionMode":["row"],"enableToggle":false},"groupSettings":{"showDropArea":true,"showToggleButton":false,"enableDropAreaAnimation":true,"showGroupedColumn":true,"showUngroupButton":true,"enableDropAreaAutoSizing":true,"captionFormat":null,"groupedColumns":[]},"contextMenuSettings":{"enableContextMenu":false,"contextMenuItems":["Add Record","Edit Record","Delete Record","Sort In Ascending Order","Sort In Descending Order","Next Page","Last Page","Previous Page","First Page","Save","Cancel","Grouping","Ungrouping"],"customContextMenuItems":[]},"filterSettings":{"filterType":"filterbar","filterBarMode":"immediate","showFilterBarStatus":true,"statusBarWidth":450,"showPredicate":false,"filteredColumns":[],"maxFilterChoices":1000,"enableCaseSensitivity":false},"sortSettings":{"sortedColumns":[]},"toolbarSettings":{"showToolbar":true,"toolbarItems":["excelExport","wordExport","pdfExport"],"customToolbarItems":[]},"minWidth":0,"scrollSettings":{"width":1168,"height":500,"enableTouchScroll":true,"allowVirtualScrolling":false,"virtualScrollMode":"normal","frozenRows":0,"frozenColumns":0},"summaryRows":[],"childGrid":null,"mergeCellInfo":null,"create":null,"actionBegin":null,"actionComplete":null,"actionFailure":null,"beginEdit":null,"endEdit":null,"endAdd":null,"endDelete":null,"beforeBatchAdd":null,"beforeBatchSave":null,"beforeBatchDelete":null,"batchAdd":null,"batchDelete":null,"cellSave":null,"cellEdit":null,"resizeStart":null,"resizeEnd":null,"resized":null,"load":null,"destroy":null,"rowSelecting":null,"rowSelected":null,"cellSelecting":null,"cellSelected":null,"columnSelecting":null,"columnSelected":null,"columnDragStart":null,"columnDrag":null,"columnDrop":null,"dataBound":null,"recordClick":null,"recordDoubleClick":null,"rightClick":null,"detailsCollapse":null,"detailsExpand":null,"contextOpen":null,"contextClick":null,"columns":[{"headerText":"Manage","commands":[{"type":"edit","buttonOptions":{"text":"Edit","width":"50","click":"onGridRecordEdit"}},{"type":"delete","buttonOptions":{"text":"Delete","width":"50","click":"onGridRecordDelete"}}],"isUnbound":true,"textAlign":"center","width":36,"visible":true,"field":"","type":null,"allowSorting":false,"allowFiltering":false,"allowGrouping":false},{"field":"ID","isPrimaryKey":true,"headerText":["#"],"textAlign":"right","width":8,"visible":false,"type":"object"},{"field":"ElementID","isPrimaryKey":false,"headerText":["Entry ID"],"textAlign":"left","width":20,"visible":false,"type":"object"},{"field":"UserHashKey","isPrimaryKey":false,"headerText":["User Hash Key"],"textAlign":"left","width":20,"visible":false,"type":"object"},{"field":"Name191","isPrimaryKey":false,"headerText":["Name"],"textAlign":"left","width":100,"visible":true,"type":"object"},{"field":"Type193","isPrimaryKey":false,"headerText":["Type"],"textAlign":"center","width":18,"visible":true,"type":"object"},{"field":"Order192","isPrimaryKey":false,"headerText":["Order"],"textAlign":"center","width":40,"visible":true,"type":"object"}],"isResponsive":false,"enableResponsiveRow":false,"commonWidth":200,"keyConfigs":{"focus":"e","insertRecord":"45","deleteRecord":"46","editRecord":"113","saveRequest":"13","cancelRequest":"27","nextPage":"34","previousPage":"33","lastPage":"ctrl+alt+34","firstPage":"ctrl+alt+33","nextPager":"alt+34","previousPager":"alt+33","firstCellSelection":"36","lastCellSelection":"35","firstRowSelection":"ctrl+36","lastRowSelection":"ctrl+35","upArrow":"38","downArrow":"40","rightArrow":"39","leftArrow":"37","moveCellRight":"9","moveCellLeft":"shift+9","selectedGroupExpand":"alt+40","totalGroupExpand":"ctrl+40","selectedGroupCollapse":"alt+38","totalGroupCollapse":"ctrl+38"}}'></form>
Thanks for using Syncfusion products.
We have analyzed your code snippet and the found that you have used below Online WebService for exporting Grid. The below online WebAPI service is specifically created for JS Grid Exporting demo sample in Online JS Sample Browser and it cannot be used for any other sample.
http://js.syncfusion.com/ExportingServices/api/JSGridExport/ExcelExport
We need to create a service for exporting based on the Grid Exporting sample and we have already created a KB on this. Please refer the following KB link.
http://www.syncfusion.com/kb/4487/how-to-export-grid-to-word-excel-and-pdf-in-javascript
Please let us know if you need any further assistance.
Regards,
Alan Sangeeth S
Hi Ryan,
Thanks for using Syncfusion products.
We have analyzed your code snippet and the found that you have used below Online WebService for exporting Grid. The below online WebAPI service is specifically created for JS Grid Exporting demo sample in Online JS Sample Browser and it cannot be used for any other sample.
http://js.syncfusion.com/ExportingServices/api/JSGridExport/ExcelExport
We need to create a service for exporting based on the Grid Exporting sample and we have already created a KB on this. Please refer the following KB link.
http://www.syncfusion.com/kb/4487/how-to-export-grid-to-word-excel-and-pdf-in-javascript
Please let us know if you need any further assistance.
Regards,
Alan Sangeeth S
Hi Alan,
Sorry for the delay in getting back to you. Please find the response.
Query: “Only issue I am having right now is trouble finding the right DLL references to include to the project and what using to use after”
Please refer the below list of DLLs required to perform export operation in JS Grid.
1. Syncfusion.EJ
2. Syncfusion.EJ.Export
3. Syncfusion.Core
4. Syncfusion.Compression.Base
5. Syncfusion.Linq.Base
6. Syncfusion.DocIo.Base
7. Syncfusion.XlsIo.Base
8. Syncfusion.Pdf.Base
And also please refer the below link for using Export feature in Grid.
http://www.syncfusion.com/kb/javascript/ejgrid?sortId=0&tags=export
http://www.syncfusion.com/kb/aspnetmvc/grid?sortId=0&tags=exporting
http://www.syncfusion.com/kb/aspnet/grid?sortId=0&tags=export
Please let us know if you have any queries.
Regards,
Madhu Sudhanan. P
- 4 Replies
- 3 Participants
-
RO Ryan Obbink
- Jul 12, 2015 10:41 PM UTC
- Aug 4, 2015 09:56 AM UTC