Skip to content

Commit 455ec90

Browse files
committed
Add new examples for management on Cells Cloud Services 40.
1 parent 565c42c commit 455ec90

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/sdkbuild2run.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ jobs:
3939
python .\Example_ConvertChartToImage.py
4040
python .\Example_ConvertRangeToImage.py
4141
python .\Example_ConvertExcel.py
42+
python .\Example_Management.py

examples/Example_Management.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import base64
2+
import os
3+
import shutil
4+
5+
from asposecellscloud.apis.cells_api import CellsApi
6+
from asposecellscloud.models import *
7+
from asposecellscloud.requests import *
8+
9+
EmployeeSalesSummaryXlsx = "EmployeeSalesSummary.xlsx"
10+
RemoteFolder = "PythonSDK"
11+
# Get Cells Cloud SDK instance
12+
# If no environment variables are configured, please obtain the ClientId and ClientSecret from https://dashboard.aspose.cloud/#/applications and replace the following values:
13+
# cells_cloud = CellsApi('YourClientId','YourClientSecret')
14+
cells_cloud = CellsApi(os.getenv('CellsCloudTestClientId'),os.getenv('CellsCloudTestClientSecret'))
15+
16+
# Create blank spreadsheet
17+
cells_cloud.create_spreadsheet( CreateSpreadsheetRequest( format="xlsb"),local_outpath ="blank_spreadsheet.xlsb" )
18+
# Create template spreadsheet
19+
cells_cloud.create_spreadsheet( CreateSpreadsheetRequest( format="xlsb" , template="SalesDataComparisonXLSX"),local_outpath ="SalesDataComparison.xlsb" )
20+
# Add worksheet into spreadsheet
21+
cells_cloud.add_worksheet_to_spreadsheet(
22+
AddWorksheetToSpreadsheetRequest( spreadsheet= EmployeeSalesSummaryXlsx ,position=0,sheet_name= "NewSalesData" ),
23+
local_outpath = "EmployeeSalesSummary_AddNewSalesData.xlsx" )
24+
# Worksheet rename
25+
cells_cloud.rename_worksheet_in_spreadsheet(
26+
RenameWorksheetInSpreadsheetRequest(spreadsheet="EmployeeSalesSummary_AddNewSalesData.xlsx" , source_name="NewSalesData" ,target_name="2025SalesData" ),
27+
local_outpath = "EmployeeSalesSummary_RenameNewSalesData.xlsx" )
28+
# Move worksheet position.
29+
cells_cloud.move_worksheet_in_spreadsheet(
30+
MoveWorksheetInSpreadsheetRequest(spreadsheet="EmployeeSalesSummary_RenameNewSalesData.xlsx", worksheet="2025SalesData", position=2),
31+
local_outpath = "EmployeeSalesSummary_MoveNewSalesData.xlsx")
32+
#Deletge worksheet.
33+
cells_cloud.delete_worksheet_from_spreadsheet(
34+
DeleteWorksheetFromSpreadsheetRequest(spreadsheet= "EmployeeSalesSummary_RenameNewSalesData.xlsx" , sheet_name="2025SalesData" ),
35+
local_outpath = "EmployeeSalesSummary_DeleteNewSalesData.xlsx" )

0 commit comments

Comments
 (0)