Free Support Forum - aspose.cloud

Save Chart Image folder question


#1

I am using aspose.cloud:443/v1.1/cells/Book1.xlsx/worksheets/Sheet1/charts/0?format=png to save a chart as an image.

However, when i try add the folder using ?folder=foldername it throw an error. could your advise ?


#2

@Measleboy

Thanks for your inquiry. You may use Aspose.Cell Cloud SDK for .NET as following to save the chart image from a file in specified folder. However, we are investigating the REST API issue and will update you soon.

static CellsChartsApi cellsChartsApi = new CellsChartsApi("client_credentials", MyAppSid, MyAppKey);
// Invoke Aspose.Cells Cloud SDK API to convert chart to image

var apiResponse = cellsChartsApi.CellsChartsGetWorksheetChart(fileName, sheetName, chartNumber, format,folder,null);

// Save stream response to image file
Console.WriteLine("Expected response type is Stream: " + apiResponse.Length.ToString());                                               
var fileStream = System.IO.File.Create("C:\\Temp\\test.png");
apiResponse.CopyTo(fileStream);
fileStream.Close();

#3

@Measleboy

Please find sample cURL command for saving the chart image from a file in the specified folder. Hopefully it will help you to accomplish the task.

curl -v "https://api.aspose.cloud/v1.1/cells/Book1.xlsx/worksheets/Sheet6/charts/0?format=png&folder=input" -X GET -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer [Access_Token]" --output C:/Temp/chart.png


#4

Excellent! thanks @tilal.ahmad all works perfectly now. thanks for the pointer.