We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

GridJsWorkbook Exception

Hi,

We are developing WebApi to support online Excel editing.
(quite similar to https://github.com/aspose-cells/Aspose.Cells-for-.NET).

I’m currently working on the “Download” API.
When trying to test my API with test data taken from your example

Using this code:

var gridJsWorkbook = new GridJsWorkbook();
GridJsWorkbook.CacheImp = Storage as Cache;
gridJsWorkbook.MergeExcelFileFromJson(uid, data.ToString());

With this JSON input data (in the “uid” parameter):BasicTestToSaveData.zip (1.1 KB)

I’m getting the exception below:
’Unable to cast object of type ‘Newtonsoft.Json.Linq.JObject’ to type 'Newtonsoft.Json.Linq.JArray’

Any ideas?

Thank in advance,
Ori K.

The JSON input data structure is not correct .
after you run the gridjs demo , do some edit operation,
then in the browser console, you can type:
xs.getUpdateDatas() (all the worksheets)
and
xs.sheet.data.getDataForSave() (active worksheet)
to watch the basic json structure for the post data for download action

do a save operation and check the post data

Hi Peter,

Thank you for your replay.
This is a good idea, but when I try it the system doesn’t recognized the xs variable.

Is there a way to figure out what should be used on your demo (I took your official demo a week ago).

Also - I trying to understand what is wrong in the format I’m using, this was also taken from the your example (while debugging the c# code, EditorApiController.Download(), I just used the value received in “p”).

Thanks in advanced,
Ori

this is the demo link ,


run the project
in the basic html file in line 114,you can see the defintion for the xs

so if you type the xs in browser console ,it show be show as expected

Thanks again for your quick response :slightly_smiling_face:

I’m running a differnt demo of yours
image.png (12.1 KB)

using this solution - https://github.com/aspose-cells/Aspose.Cells-for-.NET/blob/master/Demos/aspose.cells.live.demos.sln

It took quite a while to activate it… and there I cannot use the “xs” variable.
Can you please direct me on how can run it on this demo?

Thanks !!
Ori

Well - I managed to activate this demo:

I can run the command line in the console.
Will update if there will issue with exporting the data.

Thanks!