Skip to content

Instantly share code, notes, and snippets.

@aspose-cells
Last active September 5, 2017 12:55
Show Gist options
  • Save aspose-cells/0c40af270fa7ae0ad4ec3936676653b8 to your computer and use it in GitHub Desktop.
Save aspose-cells/0c40af270fa7ae0ad4ec3936676653b8 to your computer and use it in GitHub Desktop.
This Gist contains C# code snippets for examples of Aspose.Cells for Cloud
Aspose.Cells-for-Cloud
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Book1.xlsx";
string sheetName = "Sheet1";
string cellName = "A1";
string cellValue = "121211212112";
string type = "string";
Com.Aspose.Cells.Model.Font font = new Com.Aspose.Cells.Model.Font();
font.IsBold = true;
font.Size = 24;
Com.Aspose.Cells.Model.FontSetting fontSetting = new Com.Aspose.Cells.Model.FontSetting();
fontSetting.Length = 5;
fontSetting.StartIndex = 0;
fontSetting.Font = font;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set cell value of worksheet and apply rich text formatting
CellResponse cellResponse = cellsApi.PostWorksheetCellSetValue(fileName, sheetName, cellName, cellValue, type, null, storage, folder);
SaaSposeResponse apiResponse = cellsApi.PostCellTextFormatting(fileName, sheetName, cellName, fontSetting, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Apply Rich Text Formatting to a Cell, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Book1.xlsx";
string sheetName = "Sheet1";
string cellName = "A1";
string formula = "NOW()";
Com.Aspose.Cells.Model.CalculationOptions options = new Com.Aspose.Cells.Model.CalculationOptions();
options.CalcStackSize = 1;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set cell value of worksheet and calculate cell formula
CellResponse cellResponse = cellsApi.PostWorksheetCellSetValue(fileName, sheetName, cellName, null, null, formula, storage, folder);
SaaSposeResponse apiResponse = cellsApi.PostCalulateCellFormula(fileName, sheetName, cellName, options, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Calculate cell formula, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String cellName = "a12";
String storage = "";
String folder = "";
Style body = new Style();
Com.Aspose.Cells.Model.ThemeColor themeColor = new Com.Aspose.Cells.Model.ThemeColor();
themeColor.ColorType = "Text2";
themeColor.Tint = 1;
body.BackgroundThemeColor = themeColor;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to change cell style
StyleResponse apiResponse = cellsApi.PostUpdateWorksheetCellStyle(fileName, sheetName, cellName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Change Cell Style in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String range = "";
int startRow = 1;
int startColumn = 1;
int endRow = 2;
int endColumn = 2;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to clear contents and styles of cells in excel worksheet
SaaSposeResponse apiResponse = cellsApi.PostClearContents(fileName, sheetName, range, startRow, startColumn, endRow, endColumn, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Clear Contents and Styles of Cells in Excel Worksheet , Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String range = "A1:A12";
int? startRow = null;
int? startColumn = null;
int? endRow = null;
int? endColumn = null;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to clear cell formatting
SaaSposeResponse apiResponse = cellsApi.PostClearFormats(fileName, sheetName, range, startRow, startColumn, endRow, endColumn, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Clear Cells' Formatting in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String cellName = "a1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get cell style from worksheet
StyleResponse apiResponse = cellsApi.GetWorksheetCellStyle(fileName, sheetName, cellName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Cell Font Name :: " + apiResponse.Style.Font.Name);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "a1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get cells from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Get Cell from a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "firstcell";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get first cell of excel worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Get First Cell of Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "endcell";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get last cell of worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Get Last Cell of Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "maxcolumn";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get max column from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("maxcolumn," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "maxdatacolumn";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get max data column from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("maxdatacolumn," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "maxdatarow";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get max data row from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Max data Row," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "maxrow";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get max rows from excel worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Max Row," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int mergedCellIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get merged cells from worksheet
MergedCellResponse apiResponse = cellsApi.GetWorkSheetMergedCell(fileName, sheetName, mergedCellIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
MergedCell mergedCell = apiResponse.MergedCell;
Console.WriteLine("Merge Start Column :: " + mergedCell.StartColumn);
Console.WriteLine("Merge End Column :: " + mergedCell.EndColumn);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "mincolumn";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get min column from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("MinColumn," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "mindatacolumn";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get min data column from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("MinDataColumn," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "mindatarow";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get min data row from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("MinDataRow," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellOrMethodName = "minrow";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get min row from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("MinRow," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
int startRow = 1;
int startColumn = 1;
int totalRows = 1;
int totalColumns = 5;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to merged cells in excel worksheet
SaaSposeResponse apiResponse = cellsApi.PostWorksheetMerge(fileName, sheetName, startRow, startColumn, totalRows, totalColumns, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Merge Cells in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String cellName = "a12";
String value = "";
String type = "int";
String formula = "sum(a5:a10)";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set formula for cell
CellResponse apiResponse = cellsApi.PostWorksheetCellSetValue(fileName, sheetName, cellName, value, type, formula, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Set Formula for a Cell in Excel Worksheets, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellarea = "A10:B20";
String value = "1234";
String type = "int";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set range value in worksheet
SaaSposeResponse apiResponse = cellsApi.PostSetCellRangeValue(fileName, sheetName, cellarea, value, type, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Set Range Value in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellName = "a1";
String value = "99";
String type = "int";
String formula = "";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set cell value of worksheet
CellResponse apiResponse = cellsApi.PostWorksheetCellSetValue(fileName, sheetName, cellName, value, type, formula, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Set Value of a Cell in a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "MergeCell_Sample_Test_Book.xls";
String sheetName = "Sheet2";
int startRow = 1;
int startColumn = 1;
int totalRows = 1;
int totalColumns = 5;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to unmerged cells in excel worksheet
SaaSposeResponse apiResponse = cellsApi.PostWorksheetUnmerge(fileName, sheetName, startRow, startColumn, totalRows, totalColumns, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Unmerge Cells in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
String chartType = "bar";
int upperLeftRow = 12;
int upperLeftColumn = 12;
int lowerRightRow = 20;
int lowerRightColumn = 20;
String area = "A1:A3";
Boolean isVertical = false;
String categoryData = "";
Boolean isAutoGetSerialName = true;
String title = "SalesState";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add chart in worksheet
ChartsResponse apiResponse = cellsApi.PutWorksheetAddChart(fileName, sheetName, chartType, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, area, isVertical, categoryData, isAutoGetSerialName, title, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add a Chart in a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "Sample_Test_Book";
String fileName = name + ".xls";
String sheetName = "Sheet5";
int chartNumber = 0;
String format = "png";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to convert chart to image
ResponseMessage apiResponse = cellsApi.GetWorksheetChartWithFormat(fileName, sheetName, chartNumber, format, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert Chart to Image, done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete all charts
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetClearCharts(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete all Charts from a Worksheet ");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete chart from worksheet
ChartsResponse apiResponse = cellsApi.DeleteWorksheetDeleteChart(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete a Chart from a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete chart title
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetChartTitle(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Chart Title in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartNumber = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get chart from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetChart(fileName, sheetName, chartNumber, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Get Chart from a Worksheet, done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get chart area
ChartAreaResponse apiResponse = cellsApi.GetChartArea(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
ChartArea chartArea = apiResponse.ChartArea;
Console.WriteLine("ChatArea X :: " + chartArea.X);
Console.WriteLine("ChatArea Y :: " + chartArea.Y);
Console.WriteLine("ChatArea Area :: " + chartArea.Area);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get fill format of chart area from worksheet
FillFormatResponse apiResponse = cellsApi.GetChartAreaFillFormat(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
FillFormat chartAreaFillFormat = apiResponse.FillFormat;
Console.WriteLine("ChatArea FillFormat Type :: " + chartAreaFillFormat.Type);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get chart legend
LegendResponse apiResponse = cellsApi.GetWorksheetChartLegend(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Chart Legend Position :: " + apiResponse.Legend.Position);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to hide chart legent
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetChartLegend(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Hide Chart Legend in a Worksheet, Done! ");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
Title body = new Title();
body.Text = "aspose";
body.Height = 15;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set chart title
TitleResponse apiResponse = cellsApi.PutWorksheetChartTitle(fileName, sheetName, chartIndex, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Set Chart Title in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to show chart legend in a worksheet
SaaSposeResponse apiResponse = cellsApi.PutWorksheetChartLegend(fileName, sheetName, chartIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Show Chart Legend in a Worksheet, Done! ");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
Legend body = new Legend();
body.Height = 15;
body.Position = "Left";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to update chart legend
LegendResponse apiResponse = cellsApi.PostWorksheetChartLegend(fileName, sheetName, chartIndex, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Chart Legend Position :: " + apiResponse.Legend.Position);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
string sheetName = "sheet4";
int chartIndex = 1;
Com.Aspose.Cells.Model.Chart chart = new Com.Aspose.Cells.Model.Chart();
chart.Type = "line";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to update chart properties
SaaSposeResponse apiResponse = cellsApi.CellsChartsPostWorksheetChart(fileName, sheetName, chartIndex, chart, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Update Chart properties in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet5";
int chartIndex = 0;
String storage = "";
String folder = "";
Title body = new Title();
body.Text = "aspose";
body.Height = 15;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to update chart title
TitleResponse apiResponse = cellsApi.PostWorksheetChartTitle(fileName, sheetName, chartIndex, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Update Chart Title in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "Sheet1";
int index = 0;
String type = "CellValue";
String operatortype = "Equal";
String formula1 = "v1";
String formula2 = "v2";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add a condition for format condition
SaaSposeResponse apiResponse = cellsApi.PutWorksheetFormatConditionCondition(fileName, sheetName, index, type, operatortype, formula1, formula2, storage, folder, null);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "Sheet1";
int index = 0;
String cellArea = "A1:C3";
String type = "Expression";
String operatortype = "Between";
String formula1 = "v1";
String formula2 = "v2";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add format condition
SaaSposeResponse apiResponse = cellsApi.PutWorksheetFormatCondition(fileName, sheetName, index, cellArea, type, operatortype, formula1, formula2, storage, folder, null);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "sheet1";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to clear condition formatting
BaseResponse apiResponse = cellsApi.DeleteWorksheetConditionalFormattings(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "Sheet1";
int index = 0;
String cellArea = "A1:C3";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to put worksheet format conditional area
SaaSposeResponse apiResponse = cellsApi.PutWorksheetFormatConditionArea(fileName, sheetName, index, cellArea, storage, folder, null);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "sheet1";
int index = 0;
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get conditional formatting
ConditionalFormattingResponse apiResponse = cellsApi.GetWorksheetConditionalFormatting(fileName, sheetName, index, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "sheet1";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get worksheet conditional formatting
ConditionalFormattingResponse apiResponse = cellsApi.GetWorksheetConditionalFormattings(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "sheet1";
int startRow = 3;
int startColumn = 3;
int totalRows = 1;
int totalColumns = 1;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to remove cell area from conditional formatting
BaseResponse apiResponse = cellsApi.DeleteWorksheetConditionalFormattingArea(fileName, sheetName, startRow, startColumn, totalRows, totalColumns, null, null);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Book1.xlsx";
String sheetName = "sheet1";
int index = 0;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to remove conditional formatting
BaseResponse apiResponse = cellsApi.DeleteWorksheetConditionalFormatting(fileName, sheetName, index, null, null);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine(apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Book1.xlsx";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get all document properties
CellsDocumentPropertiesResponse apiResponse = cellsApi.GetDocumentProperties(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (CellsDocumentProperty docProperty in apiResponse.DocumentProperties.DocumentPropertyList)
{
Console.WriteLine("Name: " + docProperty.Name);
Console.WriteLine("Value: " + docProperty.Value);
Console.WriteLine("BuiltIn: " + docProperty.BuiltIn);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Book1.xlsx";
String propertyName = "Author";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get particular property
CellsDocumentPropertyResponse apiResponse = cellsApi.GetDocumentProperty(fileName, propertyName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
CellsDocumentProperty docProperty = apiResponse.DocumentProperty;
Console.WriteLine("Name: " + docProperty.Name);
Console.WriteLine("Value: " + docProperty.Value);
Console.WriteLine("BuiltIn: " + docProperty.BuiltIn);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// Set input file name
String fileName = "Sample_Book1.xlsx";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to remove all document properties
CellsDocumentPropertiesResponse apiResponse = cellsApi.DeleteDocumentProperties(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("All Properties have been removed!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Book1.xlsx";
String propertyName = "AsposeAuthor";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to remove particular property
CellsDocumentPropertiesResponse apiResponse = cellsApi.DeleteDocumentProperty(fileName, propertyName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Property have been removed!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
// Set input file name
String fileName = "Sample_Book1.xlsx";
String propertyName = "AsposeAuthor";
String storage = "";
String folder = "";
CellsDocumentProperty body = new CellsDocumentProperty();
body.Name = "AsposeAuthor";
body.Value = "Aspose Plugin Developer";
body.BuiltIn = "false";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set particular property
CellsDocumentPropertyResponse apiResponse = cellsApi.PutDocumentProperty(fileName, propertyName, storage, folder, body);
if (apiResponse != null)
{
Console.WriteLine("New values for the Property have been changed!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "Sample_Test_Book";
String fileName = name + ".xls";
String sheetName = "Sheet4";
int autoshapeNumber = 1;
String format = "png";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to convert autoshape to image
ResponseMessage apiResponse = cellsApi.GetWorksheetAutoshapeWithFormat(fileName, sheetName, autoshapeNumber, format, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert AutoShape to Image , Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string[] options = new string[4];
options[0] = "{\"BatchData\":null,\"DestinationWorksheet\":\"Sheet1\",\"IsInsert\":false,\"ImportDataType\":\"BatchData\",\"Source\":{\"FileSourceType\":1,\"FilePath\":\"Batch_data_json.txt\"}}";
options[1] = "{\"FirstRow\":1,\"FirstColumn\":2,\"IsVertical\":true,\"Data\":null,\"DestinationWorksheet\":\"Sheet1\",\"IsInsert\":true,\"ImportDataType\":\"StringArray\",\"Source\":{\"FileSourceType\":1,\"FilePath\":\"Array_string_json.txt\"}}";
options[2] = "{\"FirstRow\":1,\"FirstColumn\":2,\"IsVertical\":true,\"Data\":null,\"DestinationWorksheet\":\"Sheet1\",\"IsInsert\":true,\"ImportDataType\":\"IntArray\",\"Source\":{\"FileSourceType\":1,\"FilePath\":\"Array_int_json.txt\"}}";
options[3] = "{\"FirstRow\":1,\"FirstColumn\":2,\"IsVertical\":true,\"Data\":null,\"DestinationWorksheet\":\"Sheet1\",\"IsInsert\":true,\"ImportDataType\":\"DoubleArray\",\"Source\":{\"FileSourceType\":1,\"FilePath\":\"Array_double_json.txt\"}}";
string[] dataFiles = new string[4];
dataFiles[0]= "Batch_data_json.txt";
dataFiles[1] = "Array_string_json.txt";
dataFiles [2] = "Array_int_json.txt";
dataFiles [3] = "Array_double_json.txt";
string name = "Book1.xlsx";
string storage = null;
string folder = null;
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
try
{
int i = 0;
foreach (string body in options)
{
string dataFile = dataFiles[i];
storageApi.PutCreate(dataFile, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + dataFile));
Com.Aspose.Cells.Model.SaaSposeResponse apiResponse;
apiResponse = cellsApi.PostImportData(name, storage, folder, body);
i++;
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
var xml = "<ImportBatchDataOption><DestinationWorksheet>Sheet1</DestinationWorksheet><IsInsert>false</IsInsert><ImportDataType>BatchData</ImportDataType><Source><FileSourceType>RequestFiles</FileSourceType><FilePath>Batch_data_xml_2.txt</FilePath></Source></ImportBatchDataOption>";
string name = "Book1.xlsx";
string storage = null;
string folder = null;
string batchFile = "Batch_data_xml_2.txt";
try
{
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
storageApi.PutCreate(batchFile, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + batchFile));
Com.Aspose.Cells.Model.SaaSposeResponse apiResponse = cellsApi.PostImportData(name, storage, folder, xml);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Sample_Test_Book.xls";
string sourceFileName = "Sample_Book2.xls";
string imageFileName = "aspose-logo.png";
string sheetName = "Sheet1";
int? upperLeftRow = null;
int? upperLeftColumn = null;
int? height = null;
int? width = null;
string oleFile = null;
string imageFile = null;
string storage = null;
string folder = null;
Com.Aspose.Cells.Model.OleObject body = new Com.Aspose.Cells.Model.OleObject();
body.SourceFullName = sourceFileName;
body.ImageSourceFullName = imageFileName;
body.UpperLeftRow = 15;
body.UpperLeftColumn = 5;
body.Top = 10;
body.Bottom = 10;
body.Left = 10;
body.Height = 400;
body.Width = 400;
body.IsAutoSize = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(sourceFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + sourceFileName));
storageApi.PutCreate(imageFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFileName));
// Invoke Aspose.Cells Cloud SDK API to add OleObject
OleObjectResponse apiResponse = cellsApi.PutWorksheetOleObject(fileName, sheetName, upperLeftRow, upperLeftColumn, height, width, oleFile, imageFile, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add OleObjects to Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "Sample_OleObject_Book1";
String fileName = name + ".xlsx";
String sheetName = "Sheet1";
int objectNumber = 0;
String format = "png";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to convert OleObject to image
ResponseMessage apiResponse = cellsApi.GetWorksheetOleObjectWithFormat(fileName, sheetName, objectNumber, format, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert OLE Object to Image, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Embeded_OleObject_Sample_Book1.xlsx";
String sheetName = "Sheet1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete all OleObject from excel
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetOleObjects(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete all OleObjects from Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Embeded_OleObject_Sample_Book1.xlsx";
String sheetName = "Sheet1";
int oleObjectIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete specific OleObject from excel worksheet
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetOleObject(fileName, sheetName, oleObjectIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete a specific OleObject from Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_OleObject_Book1.xlsx";
String sheetName = "Sheet1";
int objectNumber = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get OleObject from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetOleObject(fileName, sheetName, objectNumber, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("OleObject" + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Embeded_OleObject_Sample_Book1.xlsx";
string sheetName = "Sheet1";
int? oleObjectIndex = 0;
string storage = null;
string folder = null;
string sourceFileName = "Sample_Book2.xls";
string imageFileName = "aspose-logo.png";
Com.Aspose.Cells.Model.OleObject body = new Com.Aspose.Cells.Model.OleObject();
body.SourceFullName = sourceFileName;
body.ImageSourceFullName = imageFileName;
body.UpperLeftRow = 15;
body.UpperLeftColumn = 5;
body.Top = 10;
body.Bottom = 10;
body.Left = 10;
body.Height = 400;
body.Width = 400;
body.IsAutoSize = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(sourceFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + sourceFileName));
storageApi.PutCreate(imageFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFileName));
// Invoke Aspose.Cells Cloud SDK API to update specific OleObject
SaaSposeResponse apiResponse = cellsApi.PostUpdateWorksheetOleObject(fileName, sheetName, oleObjectIndex, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Update a specific OleObject from Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
string sheetName = "Sheet6";
int? upperLeftRow = 5;
int? upperLeftColumn = 5;
int? lowerRightRow = 10;
int? lowerRightColumn = 10;
string picturePath = "aspose-cloud.png";
string storage = null;
string folder = null;
byte[] file = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
storageApi.PutCreate(picturePath, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + picturePath));
// Invoke Aspose.Cells Cloud SDK API to add picture to worksheet
PicturesResponse apiResponse = cellsApi.PutWorksheetAddPicture(fileName, sheetName, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, picturePath, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add Pictures to Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String name = "Sample_Test_Book";
String fileName = name + ".xls";
String sheetName = "Sheet6";
int pictureNumber = 0;
String format = "png";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to convert picture to image
ResponseMessage apiResponse = cellsApi.GetWorksheetPictureWithFormat(fileName, sheetName, pictureNumber, format, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Convert Picture to Image, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete all pictures
SaaSposeResponse apiResponse = cellsApi.DeleteWorkSheetPictures(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete all Pictures from Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
int pictureIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete specific picture
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetPicture(fileName, sheetName, pictureIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete a specific Picture from Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
int? pictureNumber = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get picture from worksheet
ResponseMessage apiResponse = cellsApi.GetWorksheetPicture(fileName, sheetName, pictureNumber, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Picture Image Format : " + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet6";
int pictureIndex = 0;
String storage = "";
String folder = "";
Picture body = new Picture();
body.Name = "aspose-cloud-logo";
body.RotationAngle = 90.0;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to update specific picture from excel worksheet
PictureResponse apiResponse = cellsApi.PostWorkSheetPicture(fileName, sheetName, pictureIndex, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Update a specific Picture from Excel Worksheet , Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Pivot_Table_Example.xls";
String sheetName = "Sheet2";
int pivotTableIndex = 0;
String pivotFieldType = "Row";
Com.Aspose.Cells.Model.PivotTableFieldRequest body = new Com.Aspose.Cells.Model.PivotTableFieldRequest();
body.Data = new System.Collections.Generic.List<int?> { 1, 2 };
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add pivot field in pivot table
SaaSposeResponse apiResponse = cellsApi.PutPivotTableField(fileName, sheetName, pivotTableIndex, pivotFieldType, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add Pivot Field into Pivot Table, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
string sheetName = "Sheet1";
string storage = null;
string folder = null;
string sourceData = null;
string destCellName = null;
string tableName = null;
bool? useSameSource = false;
Com.Aspose.Cells.Model.CreatePivotTableRequest body = new Com.Aspose.Cells.Model.CreatePivotTableRequest();
body.Name = "MyPivot";
body.SourceData = "A5:E10";
body.DestCellName = "H20";
body.UseSameSource = true;
body.PivotFieldRows = new System.Collections.Generic.List<int?> { 1 };
body.PivotFieldColumns = new System.Collections.Generic.List<int?> { 1 };
body.PivotFieldData = new System.Collections.Generic.List<int?> { 1 };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add pivot table worksheet
PivotTableResponse apiResponse = cellsApi.PutWorksheetPivotTable(fileName, sheetName, storage, folder, sourceData, destCellName, tableName, useSameSource, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add a Pivot Table in a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Pivot_Table_Example.xls";
String sheetName = "Sheet2";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete worksheet pivot table
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetPivotTables(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Worksheet Pivot Tables, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Pivot_Table_Example.xls";
String sheetName = "Sheet2";
int pivotTableIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete worksheet pivot table by index
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetPivotTable(fileName, sheetName, pivotTableIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Worksheet Pivot Table by Index, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Pivot_Table_Example.xls";
String sheetName = "Sheet2";
int pivottableIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get worksheet pivot table informations by index
PivotTableResponse apiResponse = cellsApi.GetWorksheetPivotTable(fileName, sheetName, pivottableIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
PivotTable pivotTable = apiResponse.PivotTable;
Console.WriteLine("Name" + pivotTable.Name);
foreach (PivotItem item in pivotTable.BaseFields[0].PivotItems)
{
Console.WriteLine("Pivot Item Name :: " + item.Name);
Console.WriteLine("Pivot Item Value :: " + item.Value);
}
Console.WriteLine("Delete Row from a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Pivot_Table_Example.xls";
String sheetName = "Sheet2";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get worksheet pivot table informations
PivotTablesResponse apiResponse = cellsApi.GetWorksheetPivotTables(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Get Worksheet Pivot Tables Information, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int rowIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to add empty row in worksheet
RowResponse apiResponse = cellsApi.PutInsertWorksheetRow(fileName, sheetName, rowIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Row Href : " + apiResponse.Row.link.Href);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
Boolean isAutoFit = true;
int? startRow = 1;
int? endRow = 10;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to autofit rows in workbooks
SaaSposeResponse apiResponse = cellsApi.PostAutofitWorkbookRows(fileName, startRow, endRow, isAutoFit, storage, folder, null);
if (apiResponse != null)
{
Console.WriteLine("Auto Fit Rows in Excel Workbooks, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
int sourceRowIndex = 1;
int destinationRowIndex = 1;
int rowNumber = 1;
String worksheet = "Sheet1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to copy rows in worksheet
SaaSposeResponse apiResponse = cellsApi.PostCopyWorksheetRows(fileName, sheetName, sourceRowIndex, destinationRowIndex, rowNumber, worksheet, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Copy Rows in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int rowIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete row from worksheet
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetRow(fileName, sheetName, rowIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Row from a Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int rowIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get row from worksheet
RowResponse apiResponse = cellsApi.GetWorksheetRow(fileName, sheetName, rowIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Row Href : " + apiResponse.Row.link.Href);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int firstIndex = 1;
int lastIndex = 1;
Boolean hide = false;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to group rows in worksheet
SaaSposeResponse apiResponse = cellsApi.PostGroupWorksheetRows(fileName, sheetName, firstIndex, lastIndex, hide, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Group Rows in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int startrow = 1;
int totalRows = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to hide rows in worksheet
SaaSposeResponse apiResponse = cellsApi.PostHideWorksheetRows(fileName, sheetName, startrow, totalRows, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Hide Rows in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Group_Rows_Sample_Test_Book.xls";
String sheetName = "Sheet1";
int firstIndex = 1;
int lastIndex = 1;
Boolean hide = false;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to ungroup rows in worksheet
SaaSposeResponse apiResponse = cellsApi.PostUngroupWorksheetRows(fileName, sheetName, firstIndex, lastIndex, hide, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("UnGroup Rows in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Hide_Row_Sample_Test_Book.xls";
String sheetName = "Sheet1";
int startrow = 1;
int totalRows = 1;
Double height = 1.0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to unhide rows in excel workbook
SaaSposeResponse apiResponse = cellsApi.PostUnhideWorksheetRows(fileName, sheetName, startrow, totalRows, height, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Unhide Rows in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Book1.xlsx";
string sheetName = "sheet7";
int listObjectIndex = 1;
Com.Aspose.Cells.Model.DataSorter dataSorter = new Com.Aspose.Cells.Model.DataSorter();
Com.Aspose.Cells.Model.SortKey sortKey = new Com.Aspose.Cells.Model.SortKey();
sortKey.Key = 1;
sortKey.SortOrder = "Ascending";
dataSorter.CaseSensitive = "true";
dataSorter.KeyList = new System.Collections.Generic.List<Com.Aspose.Cells.Model.SortKey> { sortKey };
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to sort table data
SaaSposeResponse apiResponse = cellsApi.PostSortTableData(fileName, sheetName, listObjectIndex, dataSorter, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Sort tabl data, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "TaskBook.xlsx";
string file1 = "Batch_data_xml.txt";
string file2 = "Batch_data_xml_2.txt";
string taskData = @"<TaskData>
<Tasks>
<TaskDescription>
<TaskType>ImportData</TaskType>
<ImportDataTaskParameter>
<Workbook>
<FileSourceType>CloudFileSystem</FileSourceType>
<FilePath>TaskBook.xlsx</FilePath>
</Workbook>
<ImportBatchDataOption>
<DestinationWorksheet>Sheet1</DestinationWorksheet>
<IsInsert>true</IsInsert>
<Source>
<FileSourceType>RequestFiles</FileSourceType>
<FilePath>Batch_data_xml.txt</FilePath>
</Source>
</ImportBatchDataOption>
</ImportDataTaskParameter>
</TaskDescription>
<TaskDescription>
<TaskType>ImportData</TaskType>
<ImportDataTaskParameter>
<Workbook>
<FileSourceType>InMemoryFiles</FileSourceType>
<FilePath>TaskBook.xlsx</FilePath>
</Workbook>
<ImportBatchDataOption>
<DestinationWorksheet>Sheet2</DestinationWorksheet>
<IsInsert>true</IsInsert>
<Source>
<FileSourceType>RequestFiles</FileSourceType>
<FilePath>Batch_data_xml_2.txt</FilePath>
</Source>
</ImportBatchDataOption>
</ImportDataTaskParameter>
</TaskDescription>
<TaskDescription>
<TaskType>SaveResult</TaskType>
<SaveResultTaskParameter>
<ResultSource>InMemoryFiles</ResultSource>
<ResultDestination>
<DestinationType>CloudFileSystem</DestinationType>
<InputFile>TaskBook.xlsx</InputFile>
<OutputFile>ImpDataBook.xlsx</OutputFile>
</ResultDestination>
</SaveResultTaskParameter>
</TaskDescription>
</Tasks>
</TaskData>";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
storageApi.PutCreate(file1, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + file1));
storageApi.PutCreate(file2, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + file2));
// Invoke Aspose.Cells Cloud SDK API to import task data
var response = cellsApi.PostTaskDataMultipartContent(taskData, storage, folder, Common.GetDataDir() + file1, Common.GetDataDir() + file2);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String text = "aspose";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to find text in workbook
TextItemsResponse apiResponse = cellsApi.PostWorkbooksTextSearch(fileName, text, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem item in apiResponse.TextItems.TextItemList)
{
Console.WriteLine("Text: " + item.Text);
Console.WriteLine("Href: " + item.link.Href);
Console.WriteLine("");
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String text = "aspose";
String sheetName = "Sheet2";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to find text in worksheet
TextItemsResponse apiResponse = cellsApi.PostWorkSheetTextSearch(fileName, sheetName, text, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem item in apiResponse.TextItems.TextItemList)
{
Console.WriteLine("Text: " + item.Text);
Console.WriteLine("Href: " + item.link.Href);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get text items from workbook
TextItemsResponse apiResponse = cellsApi.GetWorkBookTextItems(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem item in apiResponse.TextItems.TextItemList)
{
Console.WriteLine("Text: " + item.Text);
Console.WriteLine("Href: " + item.link.Href);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get text items from worksheet
TextItemsResponse apiResponse = cellsApi.GetWorkSheetTextItems(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
foreach (TextItem item in apiResponse.TextItems.TextItemList)
{
Console.WriteLine("Text: " + item.Text);
Console.WriteLine("Href: " + item.link.Href);
}
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String oldValue = "aspose";
String newValue = "aspose.com";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to replace text in workbook
WorkbookReplaceResponse apiResponse = cellsApi.PostWorkbooksTextReplace(fileName, oldValue, newValue, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Matches: " + apiResponse.Matches);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String oldValue = "aspose";
String newValue = "aspose.com";
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to replace text in worksheet
WorksheetReplaceResponse apiResponse = cellsApi.PostWorsheetTextReplace(fileName, sheetName, oldValue, newValue, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Matches: " + apiResponse.Matches);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string storage = null;
string folder = null;
bool ignoreEroor = true;
Com.Aspose.Cells.Model.CalculationOptions body = new Com.Aspose.Cells.Model.CalculationOptions();
body.CalcStackSize = 1;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to calculate all formulas in workbook
SaaSposeResponse apiResponse = cellsApi.PostWorkbookCalculateFormula(name, ignoreEroor, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Calculate all formulas, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book";
String inputfileName = fileName + ".xls";
String format = "pdf";
String outputFileName = fileName + "." + format;
Boolean isAutoFitRows = false;
Boolean isAutoFitColumns = false;
String storage = "";
String folder = "";
SaveOptions body = new SaveOptions();
body.CalculateFormula = true;
body.CheckFontCompatibility = false;
body.Compliance = "None";
body.OnePagePerSheet = false;
body.SaveFormat = "pdf";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(inputfileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + inputfileName));
// Invoke Aspose.Cells Cloud SDK API to convert excel workbook to different format
SaveResponse apiResponse = cellsApi.PostDocumentSaveAs(inputfileName, outputFileName, isAutoFitRows, isAutoFitColumns, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
string destFileName = apiResponse.SaveResult.DestDocument.Href;
Console.WriteLine("File name:" + destFileName);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book";
String inputfileName = fileName + ".xls";
String format = "pdf";
String password = "";
String outPath = "";
String outputFileName = fileName + "." + format;
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + inputfileName);
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(inputfileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + inputfileName));
// Invoke Aspose.Cells Cloud SDK API to convert excel workbook to different format without storage
ResponseMessage apiResponse = cellsApi.PutConvertWorkBook(format, password, outPath, file, null);
if (apiResponse.Status.Equals("OK"))
{
Console.WriteLine("File Converted successfully to:" + outputFileName);
Console.ReadKey();
}
else
{
Console.WriteLine("status:" + apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book";
String inputfileName = fileName + ".xls";
String format = "pdf";
String password = "";
String outputFileName = fileName + "." + format;
SaveOptions body = new SaveOptions();
body.CalculateFormula = true;
body.CheckFontCompatibility = false;
body.Compliance = "None";
body.OnePagePerSheet = false;
body.SaveFormat = "pdf";
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + inputfileName);
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(inputfileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + inputfileName));
// Invoke Aspose.Cells Cloud SDK API to convert workbook with additional settings
ResponseMessage apiResponse = cellsApi.PutConvertWorkBook(format, password, outputFileName, file, body);
if (apiResponse.Status.Equals("Ok"))
{
Console.WriteLine("File Converted successfully to:" + outputFileName);
Console.ReadKey();
}
else
{
Console.WriteLine("status:" + apiResponse.Status);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book" + new Random().Next(100) + ".xls";
String templateFile = null;
String dataFile = null;
byte[] file = null;
String storage = null;
String folder = null;
try
{
// Invoke Aspose.Words Cloud SDK API to create excel empty workbook
WorkbookResponse apiResponse = cellsApi.PutWorkbookCreate(fileName, templateFile, dataFile, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
String outPutFileName = apiResponse.Workbook.FileName;
Console.WriteLine("File name:" + outPutFileName);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book" + new Random().Next(100) + ".xls";
String templateFile = "Sample_SmartMarker.xlsx";
String dataFile = "Sample_SmartMarker_Data.xml";
byte[] file = null;
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Upload SmartMarker template data file to aspose cloud storage
storageApi.PutCreate(dataFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + dataFile));
// Invoke Aspose.Cells Cloud SDK API to create workbook from smartmaker template
WorkbookResponse apiResponse = cellsApi.PutWorkbookCreate(fileName, templateFile, dataFile, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
String outPutFileName = apiResponse.Workbook.FileName;
Console.WriteLine("File name:" + outPutFileName);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book" + new Random().Next(100) + ".xls";
String templateFile = "Sample_Test_Book.xls";
String dataFile = null;
byte[] file = null;
String storage = null;
String folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
// Invoke Aspose.Cells Cloud SDK API to create workbook from template
WorkbookResponse apiResponse = cellsApi.PutWorkbookCreate(fileName, templateFile, dataFile, storage, folder, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
String outPutFileName = apiResponse.Workbook.FileName;
Console.WriteLine("File name:" + outPutFileName);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String filePrefix = "encrypted_";
String fileName = filePrefix + "Sample_Test_Book.xls";
String storage = "";
String folder = "";
WorkbookEncryptionRequest body = new WorkbookEncryptionRequest();
body.EncryptionType = "XOR";
body.Password = "aspose";
body.KeyLength = 128;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to decrypt workbook
SaaSposeResponse apiResponse = cellsApi.DeleteDecryptDocument(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("File is Decrypted");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = "";
String folder = "";
WorkbookEncryptionRequest body = new WorkbookEncryptionRequest();
body.EncryptionType = "XOR";
body.Password = "aspose";
body.KeyLength = 128;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to encrypt excel workbook
SaaSposeResponse apiResponse = cellsApi.PostEncryptDocument(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("File is Encrypted");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Book1.xlsx";
String mergeWith = "Sample_Book2.xls";
String storage = "";
String folder = "";
try
{
// Upload file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Upload merge file to aspose cloud storage
storageApi.PutCreate(mergeWith, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + mergeWith));
// Invoke Aspose.Cells Cloud SDK API to merge excel workbooks
WorkbookResponse apiResponse = cellsApi.PostWorkbooksMerge(fileName, mergeWith, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
String destFileName = apiResponse.Workbook.FileName;
Console.WriteLine("File name:" + destFileName);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get names count from excel workbook
NamesResponse apiResponse = cellsApi.GetWorkBookNames(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Names count:" + apiResponse.Names.Count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = "";
String folder = "";
WorkbookProtectionRequest body = new WorkbookProtectionRequest();
body.Password = "aspose";
body.ProtectionType = "All";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to protect workbook
SaaSposeResponse apiResponse = cellsApi.PostProtectDocument(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Workbook is now protected");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "password_protected_Sample_Test_Book.xls";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to clear modify password
SaaSposeResponse apiResponse = cellsApi.DeleteDocumentUnProtectFromChanges(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Password is removed");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = "";
String folder = "";
PasswordRequest body = new PasswordRequest();
body.Password = "aspose";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set modify password
SaaSposeResponse apiResponse = cellsApi.PutDocumentProtectFromChanges(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Password is changed!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string fileName = "Sample_Test_Book.xls";
string format = "png";
int? from = null;
int? to = null;
int? horizontalResolution = null;
int? verticalResolution = null;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to split excel workbooks
SplitResultResponse apiResponse = cellsApi.PostWorkbookSplit(fileName, format, from, to, horizontalResolution, verticalResolution, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Workbook is splited!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Protected_Test_Book.xls";
String storage = "";
String folder = "";
WorkbookProtectionRequest body = new WorkbookProtectionRequest();
body.Password = "aspose";
body.ProtectionType = "All";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Words Cloud SDK API to unprotect workbook
SaaSposeResponse apiResponse = cellsApi.DeleteUnProtectDocument(fileName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Workbook is now un-protected");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
string operatorType1 = "LessOrEqual";
string criteria1 = "1";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add custom filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetCustomFilter(name, sheetName, range, fieldIndex, operatorType1, criteria1, null, null, null, null, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add worksheet custom filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
string dateTimeGroupingType = "Year";
int year = 1920;
bool matchBlanks = false;
bool refresh = true;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add data filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetDateFilter(name, sheetName, range, fieldIndex, dateTimeGroupingType, year, null, null, null, null, null, matchBlanks, refresh, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add worksheet data filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
string dynamicFilterType = "BelowAverage";
bool matchBlanks = true;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add dynamic filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetDynamicFilter(name, sheetName, range, fieldIndex, dynamicFilterType, matchBlanks, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add dynamic filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
string iconSetType = "ArrowsGray3";
int iconId = 1;
bool matchBlanks = false;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add icon filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetIconFilter(name, sheetName, range, fieldIndex, iconSetType, iconId, matchBlanks, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add icon filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2-new";
String storage = "";
String folder = "";
try
{
// Invoke Aspose.Cells Cloud SDK API to add new excel sheet
WorksheetsResponse apiResponse = cellsApi.PutAddNewWorksheet(fileName, sheetName, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Added a New Excel Worksheet!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "AutoFilter.xlsx";
string sheetName = "Sheet1";
string range = "A1:B13";
int fieldIndex = 0;
string criteria = "Year";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add worksheet filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetFilter(name, sheetName, range, fieldIndex, criteria, null, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add worksheet filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String formula = "SUM(A5:A10)";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to calculate formula in a worksheet
SingleValueResponse apiResponse = cellsApi.GetWorkSheetCalculateFormula(fileName, sheetName, formula, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
SingleValue resultValue = apiResponse.Value;
Console.WriteLine("Calculated value:" + resultValue.Value);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book";
String fileExtension = ".xls";
String sheetName = "Sheet1";
String format = "png";
int? verticalResolution = null;
int? horizontalResolution = null;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName + fileExtension));
// Invoke Aspose.Cells Cloud SDK API to convert worksheet to image
ResponseMessage apiResponse = cellsApi.GetWorkSheetWithFormat(fileName + fileExtension, sheetName, format, verticalResolution, horizontalResolution, storage, folder);
if (apiResponse != null)
{
Console.WriteLine("Worksheet converted to Image!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet7";
String sourceSheet = "Sheet1";
String folder = "";
String storage = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
Com.Aspose.Cells.Model.CopyOptions options = new Com.Aspose.Cells.Model.CopyOptions();
options.CopyNames = true;
// Invoke Aspose.Cells Cloud SDK API to copy excel worksheet
SaaSposeResponse apiResponse = cellsApi.PostCopyWorksheet(fileName, sheetName, sourceSheet, folder, storage, options);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Excel Worksheet copied!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
int fieldIndex = 0;
string dateTimeGroupingType = "Year";
int year = 1920;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to remove worksheet data filter
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetDateFilter(name, sheetName, fieldIndex, dateTimeGroupingType, year, null, null, null, null, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete worksheet data filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
int fieldIndex = 0;
string criteria = "Year";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to delete worksheet filter
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetFilter(name, sheetName, fieldIndex, criteria, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete worksheet filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "WorkSheetBackground_Sample_Test_Book.xls";
String sheetName = "Sheet1";
String folder = "";
String storage = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete background or watermark of worksheet
SaaSposeResponse apiResponse = cellsApi.DeleteWorkSheetBackground(fileName, sheetName, folder, storage);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Delete Background or Watermark of Excel Worksheet!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to delete worksheet comments
SaaSposeResponse apiResponse = cellsApi.DeleteWorkSheetComments(fileName, sheetName, storage, folder); ;
if (apiResponse != null)
{
Console.WriteLine("Delete All Comments in a Worksheet! Done.");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
Com.Aspose.Cells.Model.ColorFilterRequest body = new Com.Aspose.Cells.Model.ColorFilterRequest();
Com.Aspose.Cells.Model.ColorFilter colorFilter = new Com.Aspose.Cells.Model.ColorFilter();
Com.Aspose.Cells.Model.CellsColor cellsColor = new Com.Aspose.Cells.Model.CellsColor();
Com.Aspose.Cells.Model.Color color = new Com.Aspose.Cells.Model.Color();
color.A = "255";
color.B = "255";
color.G = "255";
color.R = "0";
cellsColor.Color = color;
body.Pattern = "Solid";
body.ForegroundColor = cellsColor;
body.BackgroundColor = cellsColor;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to filter list using color filter
WorksheetResponse apiResponse = cellsApi.PutWorksheetColorFilter(name, sheetName, range, fieldIndex, body, null, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Filter list using color filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string range = "A1:B1";
int fieldIndex = 0;
bool isTop = true;
int itemCount = 1;
bool matchBlanks = true;
bool isPercent = true;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to add filter to top 10
WorksheetResponse apiResponse = cellsApi.PutWorksheetFilterTop10(name, sheetName, range, fieldIndex, isTop, itemCount, isPercent, matchBlanks, null, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Add filter to top 10, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int row = 1;
int column = 1;
int freezedRows = 1;
int freezedColumns = 1;
String folder = "";
String storage = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to freeze panes in excel worksheet
SaaSposeResponse apiResponse = cellsApi.PutWorksheetFreezePanes(fileName, sheetName, row, column, freezedRows, freezedColumns, folder, storage);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Freeze Panes in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet4";
int autoshapeNumber = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get autoshape from worksheet
AutoShapeResponse apiResponse = cellsApi.GetWorksheetAutoshape(fileName, sheetName, autoshapeNumber, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
AutoShape autoShape = apiResponse.AutoShape;
Console.WriteLine(autoShape.HtmlText);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int? columnIndex = 1;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get column from worksheet
ColumnResponse apiResponse = cellsApi.GetWorksheetColumn(fileName, sheetName, columnIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Href:" + apiResponse.Column.link.Href);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet2";
String cellName = "A4";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to get comment from worksheet
CommentResponse apiResponse = cellsApi.GetWorkSheetComment(fileName, sheetName, cellName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Comment:" + apiResponse.Comment.Note);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int validationIndex = 0;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Words Cloud SDK API to get validation from worksheet
ValidationResponse apiResponse = cellsApi.GetWorkSheetValidation(fileName, sheetName, validationIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Validation Type:" + apiResponse.Validation.Type);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to get worksheet autofilter
ResponseMessage apiResponse = cellsApi.GetWorksheetAutoFilter(name, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("Ok"))
{
Console.WriteLine("Get worksheet autofilter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Words Cloud SDK API to get worksheet count
WorksheetsResponse apiResponse = cellsApi.GetWorkSheets(fileName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Sheet Count: " + apiResponse.Worksheets.WorksheetList.Count);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
Boolean isVisible = false;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to hide excel worksheet
WorksheetResponse apiResponse = cellsApi.PutChangeVisibilityWorksheet(fileName, sheetName, isVisible, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Visibility Type: " + apiResponse.Worksheet.VisibilityType);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
int fieldIndex = 0;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to match all blanks cells in the list
SaaSposeResponse apiResponse = cellsApi.PostWorksheetMatchBlanks(name, sheetName, fieldIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Match all blanks cells in the list, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
int fieldIndex = 0;
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API to match all non blanks cells in the list
SaaSposeResponse apiResponse = cellsApi.postWorksheetMatchNonBlanks(name, sheetName, fieldIndex, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Match all non blanks cells in the list, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String storage = "";
String folder = "";
WorksheetMovingRequest body = new WorksheetMovingRequest();
body.DestinationWorksheet = "Sheet5";
body.Position = "after";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to move excel worksheets
WorksheetsResponse apiResponse = cellsApi.PostMoveWorksheet(fileName, sheetName, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("WorkSheet moved!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
string name = "Book1.xlsx";
string sheetName = "Sheet1";
string storage = null;
string folder = null;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(name, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + name));
// Invoke Aspose.Cells Cloud SDK API refresh autofilter
SaaSposeResponse apiResponse = cellsApi.PostWorksheetAutoFilterRefresh(name, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Refresh auto-filter, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to remove excel worksheets
WorksheetsResponse apiResponse = cellsApi.DeleteWorksheet(fileName, sheetName, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Worksheet have been removed!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String newname = "newSheet";
String folder = "";
String storage = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to rename excel worksheet
SaaSposeResponse apiResponse = cellsApi.PostRenameWorksheet(fileName, sheetName, newname, folder, storage);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Rename Excel Worksheet!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String folder = "";
String storage = "";
byte[] file = System.IO.File.ReadAllBytes(Common.GetDataDir() + "aspose-cloud.png");
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to set background or watermark
SaaSposeResponse apiResponse = cellsApi.PutWorkSheetBackground(fileName, sheetName, folder, storage, file);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Set Background or Watermark for Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String cellArea = "A5:A10";
String storage = "";
String folder = "";
SortKey sort = new SortKey();
sort.Key = 0;
sort.SortOrder = "descending";
DataSorter body = new DataSorter();
body.CaseSensitive = "false";
body.HasHeaders = "false";
body.SortLeftToRight = "false";
body.KeyList = new List<SortKey> { sort };
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to sort worksheet data
SaaSposeResponse apiResponse = cellsApi.PostWorksheetRangeSort(fileName, sheetName, cellArea, storage, folder, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Worksheet data is sorted!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
int row = 1;
int column = 1;
int freezedRows = 1;
int freezedColumns = 1;
String folder = "";
String storage = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to unfreez panes in excel worksheet
SaaSposeResponse apiResponse = cellsApi.DeleteWorksheetFreezePanes(fileName, sheetName, row, column, freezedRows, freezedColumns, folder, storage);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Unfreeze Panes in Excel Worksheet, Done!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
Boolean isVisible = true;
String storage = "";
String folder = "";
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to unhide excel worksheet
WorksheetResponse apiResponse = cellsApi.PutChangeVisibilityWorksheet(fileName, sheetName, isVisible, storage, folder);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Visibility Type: " + apiResponse.Worksheet.VisibilityType);
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Cloud
CellsApi cellsApi = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
String fileName = "Sample_Test_Book.xls";
String sheetName = "Sheet1";
String folder = "";
String storage = "";
Com.Aspose.Cells.Model.Worksheet body = new Com.Aspose.Cells.Model.Worksheet();
body.Type = "Worksheet";
body.Name = "Sheet1";
body.IsGridlinesVisible = true;
body.IsPageBreakPreview = true;
body.IsRulerVisible = true;
try
{
// Upload source file to aspose cloud storage
storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
// Invoke Aspose.Cells Cloud SDK API to update worksheet properties
WorksheetResponse apiResponse = cellsApi.PostUpdateWorksheetProperty(fileName, sheetName, folder, storage, body);
if (apiResponse != null && apiResponse.Status.Equals("OK"))
{
Console.WriteLine("Update Excel Worksheet Properties!");
Console.ReadKey();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment