Create Excel file from XML/JSON payload

Hello there,
I have worked with Aspose Word/PDF Merge wherein I pass the Aspose rest API a payload for any document merges. Can I do something similar -

requirement is to generate XLS/XLSX file with say a max of 100,000 rows/50-60 columns - will be using Aspose Cloud (REST apis) for the purpose.

Let me know if this is possible with Aspose Clouds cells? I couldn’t find the required api request or might be missing something

thx

Hi Sunil,

Thanks for your posting and using Aspose.Cells.

Please explain your requirements in more detail. It will be helpful if you could provide us some sample project using this feature by Aspose.Word and Aspose.Pdf.

However, you can create Workbook object from byte array if it could be helpful for you. Please see the following code. I have attached the source Excel file used in this code and output PDF generated by it for your reference.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\source.xlsx”;


byte[] bytesData = File.ReadAllBytes(filePath);


//Convert your bytes into memory stream

MemoryStream ms = new MemoryStream(bytesData);

ms.Position = 0;


//Now create workbook object from memory stream

Workbook workbook = new Workbook(ms);


//Save the workbook in PDF format

workbook.Save(“output.pdf”);



Thanks Shakeel
Solution you provided was using Java SDK’s. I am using the REST API (Cloud) referred in api.aspose.com/v1.1/

Here’s what I want to do:
1. Based on the request, I will use the api to create a new workbook and worksheet
2. I will send the data for the worksheet as an XML for the data to be inputted into the worksheet(s)

I know that (1) is possible with your api’s. Not sure abt (2) - can you help me with that?

Thanks

Hi Sunil,

Thanks for your posting and using Aspose.Cells.

You can update multiple cells in a single http request i.e you can do bulk update worksheet cells.

Please see the following thread to know about how to perform bulk update of cells for your reference.

( Bulk cell updates )

Thanks Shakeel - that helps a lot

Can you help me out with any constraints or restriction or know limits with the bulk update? How many cells can be bulk updated - we are looking at around

100000 rows * 50 columns
sometimes a max of 250,000 rows too

Hi,

Thanks for your posting and using Aspose.Cells.

There shouldn’t be any restriction, even that much large data should work. You should first give it a try with small chunks of data, then with large chunks of data and see how it goes. In case, you find any issue, let us know we will look into it and resolve it asap.

Can you please confirm on how to add multiple columns with

I am currently using the following payload and it fails

Sheet1
2
2
false
true

task
1task 2task
3task 4task
5




Sheet1
2
3
false
true

task
1task 2task
3task 4task
5



If I have only one this works fine and populates one column. I would like to populate multiple rows and columns

I also tried the following:
Sheet1 1 1 string testing 6 5 string testing 6 6 string testing 6 7 string testing

My api request looks like this:
cells/test.xls/importdata?importOption=ImportBatchDataOption&folder=foldername

I tried with importOption and without
both times i get the following response :
{“Message”:“Value cannot be null.\r\nParameter name: importOption”}


Hi,

Thanks for your posting and using Aspose.Cells for Cloud.

You can not use multiple import array, string or batch data option. Just use one of it.

For your ease, I have attached the screenshots of how these look like. Hopefully it will help you. However, I executed the C# project which I have attached in the other thread and tried batch data option, but server returned me some unknown error. Could you please try it at your end as shown in my screenshot and check the results.

Here are the links to screenshots


Attachment: ImportIntArrayOption.PNG
Attachment: ImportStringArrayOption.PNG
Attachment: ImportBatchDataOption.PNG



Thanks Shakeel.

Since I cannot specify multiple Array - only thing I can do is to use batch data option. But batch data option fails for me - it gives me the error mentioned in my prevous post - related to invalid property: importOption

I specified the importOptions as ImportBatchDataOption but din work.

Is there any information on this - I need to get a prototype of this working asap.

thx again

Hi,

Thanks for your posting and using Aspose.Cells for Cloud.

We are afraid, import batch data option is not working and returning Bad Request error.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • SAASCELLS-104 - The remote server returned an error: (400) Bad Request when Importing BatchData for cells cloud.

Hi,

Thanks for using Aspose.Cells for Cloud.

We have fixed this issue now.

I have now attached the fixed ImportBatchDataOption for your reference. Also attached the C# sample project and its output file.

Import Batch Data Option - XML Body


Sheet1
true


0
0
int
0


0
1
int
1


0
2
int
2


0
3
int
3


1
0
string
1


1
1
string
2


1
2
string
3


1
3
string
4


2
0
string
2


2
1
string
3


2
2
string
4


2
3
string
5


3
0
int
3


3
1
int
4


3
2
int
5


3
3
int
6