Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active January 6, 2021 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/3c5c9f9fff9898bb8251aa7ee9191641 to your computer and use it in GitHub Desktop.
Save aspose-cloud/3c5c9f9fff9898bb8251aa7ee9191641 to your computer and use it in GitHub Desktop.
Aspose.Cells-Cloud-SDK-RUBY
Aspose.Cells-Cloud-SDK-RUBY
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def delete_worksheet_date_filter
name = $BOOK1
sheet_name = $SHEET1
field_index = 1
date_time_grouping_type = 'Day'
year = 2018
month = 12
day = 1
hour = 1
minute = 1
second = 1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_delete_worksheet_date_filter(name, sheet_name, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.cells_auto_filter_delete_worksheet_date_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def delete_worksheet_filter
name = $BOOK1
sheet_name = $SHEET1
field_index = 1
criteria = 'test'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_delete_worksheet_filter(name, sheet_name, field_index, {:criteria=>criteria, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.delete_worksheet_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def get_worksheet_auto_filter
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_get_worksheet_auto_filter(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.get_worksheet_auto_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def post_worksheet_auto_filter_refresh
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_post_worksheet_auto_filter_refresh(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_worksheet_auto_filter_refresh
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def post_worksheet_match_blanks
name = $BOOK1
sheet_name = $SHEET1
field_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_post_worksheet_match_blanks(name, sheet_name, field_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_worksheet_match_blanks
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def post_worksheet_match_non_blanks
name = $BOOK1
sheet_name = $SHEET1
field_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_post_worksheet_match_non_blanks(name, sheet_name, field_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_worksheet_match_non_blanks
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_color_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
color = AsposeCellsCloud::Color.new({:A=>255,:B=>255,:R=>0,:G=>255})
themeColor = AsposeCellsCloud::ThemeColor.new({:Tint=>'1.0',:ColorType=>'Text2'})
foregroundcolor = AsposeCellsCloud::CellsColor.new({:Color=>color,:Type=>'Automatic',:ThemeColor=>themeColor})
color1 = AsposeCellsCloud::Color.new({:A=>0,:B=>0,:R=>255,:G=>255})
themeColor1 = AsposeCellsCloud::ThemeColor.new({:Tint=>'1.0',:ColorType=>'Text2'})
backgroundcolor = AsposeCellsCloud::CellsColor.new({:Color=>color1,:Type=>'Automatic',:ThemeColor=>themeColor1})
color_filter = AsposeCellsCloud::ColorFilterRequest.new({:ForegroundColor=>foregroundcolor,:Pattern=>'Solid',:BackgroundColor=>backgroundcolor})
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_color_filter(name, sheet_name, range, field_index, { :color_filter=>color_filter, :match_blanks=>match_blanks, :refresh=>refresh,:folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_color_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_custom_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
operator_type1 = 'LessOrEqual'
criteria1 = 'test'
is_and = false
operator_type2 = 'LessOrEqual'
criteria2 = 'test'
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_custom_filter(name, sheet_name, range, field_index, operator_type1, criteria1, {:is_and=>is_and, :operator_type2=>operator_type2, :criteria2=>criteria2, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_custom_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_date_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
date_time_grouping_type = 'Day'
year = 2019
month = 1
day = 1
hour = 1
minute = 1
second = 1
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_date_filter(name, sheet_name, range, field_index, date_time_grouping_type, {:year=>year, :month=>month, :day=>day, :hour=>hour, :minute=>minute, :second=>second, :match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_date_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_dynamic_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
dynamic_filter_type = 'May'
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_dynamic_filter(name, sheet_name, range, field_index, dynamic_filter_type, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end
cell = Cell.new()
puts cell.put_worksheet_dynamic_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
criteria = 'test'
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_filter(name, sheet_name, range, field_index, criteria, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_filter_top10
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
is_top = true
is_percent = true
item_count = 1
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_filter_top10(name, sheet_name, range, field_index, is_top, is_percent, item_count, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_filter_top10
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_icon_filter
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
field_index = 0
icon_set_type = 'None'
icon_id = 0
match_blanks = true
refresh = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_auto_filter_put_worksheet_icon_filter(name, sheet_name, range, field_index, icon_set_type, icon_id, {:match_blanks=>match_blanks, :refresh=>refresh, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.put_worksheet_icon_filter
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def clear_cells_contents
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
start_row = 1
start_column = 1
end_row = 2
end_column = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_clear_contents(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.clear_cells_contents
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def clear_formats
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
start_row = 1
start_column = 1
end_row = 2
end_column = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_clear_formats(name, sheet_name, {:range=>range, :start_row=>start_row, :start_column=>start_column, :end_row=>end_row, :end_column=>end_column, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.clear_formats
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Copy cell into cell
def copy_cell_into_cell
name = $BOOK1
dest_cell_name = 'C1'
sheet_name = $SHEET1
worksheet = $SHEET2
cellname = $CellName
row = 1
column = 1
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_copy_cell_into_cell(name, dest_cell_name, sheet_name, worksheet, {:cellname=>cellname, :row=>row, :column=>column, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.copy_cell_into_cell
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get cells info.
def get_cells_info
name = $BOOK1
sheet_name = $SHEET1
offest = 1
count = 3
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cells(name, sheet_name, {:offest=>offest, :count=>count, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.get_cells_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell's style info.
def get_worksheet_cell_style
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'C1'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.get_worksheet_cell_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'firstcell'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'endcell'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'maxcolumn'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'maxdatacolumn'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'maxdatarow'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'maxrow'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet merged cell by its index.
def get_worksheet_merged_cell_by_index
name = $BOOK1
sheet_name = $SHEET1
merged_cell_index = 1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_merged_cell(name, sheet_name, merged_cell_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.get_worksheet_merged_cell_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet merged cells.
def get_worksheet_merged_cells
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_merged_cells(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.get_worksheet_merged_cells
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'mincolumn'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'mindatacolumn'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'mindatarow'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'minrow'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
print(result)
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
## For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Calculate cell's formula
def post_calulate_cell_formula
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'A1'
value = 1
type = 'string'
formula = nil
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_worksheet_cell_set_value(name, sheet_name, cell_name, {:value=>value, :type=>type, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_calulate_cell_formula
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Rich text formatting in a single cell.
def post_cell_text_formatting
file_name = "Book1.xlsx"
upload_file(file_name)
sheet_name = "sheet1"
cell_name = "A1"
# Set cell value
response = @cells_api.post_worksheet_cell_set_value(file_name, sheet_name, cell_name, {value: "121211212112", type: "string"})
fontSetting1 = FontSetting.new
fontSetting1.length = 5
fontSetting1.start_index = 0
font1 = Font.new
font1.is_bold = true
font1.size = 24
fontSetting1.font = font1
fontSetting2 = FontSetting.new
fontSetting2.length = 4
fontSetting2.start_index = 5
font2 = Font.new
font2.is_italic = true
font2.size = 15
fontSetting2.font = font2
options = [fontSetting1, fontSetting2]
# Rich text formatting in a single cell
response = @cells_api.post_cell_text_formatting(file_name, sheet_name, cell_name, options, opts = {})
end
end
cell = Cell.new()
puts cell.post_cell_text_formatting
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update cell's style.
def post_update_worksheet_cell_style
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'C1'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell_style(name, sheet_name, cell_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.post_update_worksheet_cell_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read cell data by cell's name.
def read_cell_data_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
cell_or_method_name = 'firstcell'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_cell(name, sheet_name, cell_or_method_name, { :folder=>folder})
end
end
cell = Cell.new()
puts cell.read_cell_data_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set cell range value
def set_cell_range_value
name = $BOOK1
sheet_name = $SHEET1
cellarea = $CELLAREA
value = 1
type = 'string'
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_set_cell_range_value(name, sheet_name, cellarea, value, type, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.set_cell_range_value
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set cell value.
def set_cell_value
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'A1'
value = 1
type = 'string'
formula = nil
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_worksheet_cell_set_value(name, sheet_name, cell_name, {:value=>value, :type=>type, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.set_cell_value
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set htmlstring value into cell
def set_html_string_value_into_cell
name = $BOOK1
sheet_name = $SHEET1
cell_name = $CellName
folder = $TEMPFOLDER
storage = nil
html_string ="sssssssssssssssssssssss"
# result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
# expect(result.uploaded.size).to be > 0
result = @instance.cells_post_set_cell_html_string(name, sheet_name, cell_name, html_string, { :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.set_html_string_value_into_cell
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Cell
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update cell's style.
def update_cell_style
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'A1'
style = AsposeCellsCloud::Style.new
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_update_worksheet_cell_style(name, sheet_name, cell_name,{ :style=>style, :folder=>folder})
expect(result.code).to eql(200)
end
end
cell = Cell.new()
puts cell.update_cell_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add chart title / Set chart title visible
def add_chart_title
sheet_name = $SHEET3
chart_index = 0
title = AsposeCellsCloud::Title.new
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_put_worksheet_chart_title(name, sheet_name, chart_index, {:title=>title, :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.add_chart_title
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add new chart to worksheet.
def add_new_chart_to_worksheet
name = $MYDOC
sheet_name = $SHEET3
chart_type = 'Pie'
upper_left_row = 5
upper_left_column = 5
lower_right_row = 10
lower_right_column = 10
area = $CELLAREA
is_vertical = true
category_data = nil
is_auto_get_serial_name = nil
title = nil
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_put_worksheet_add_chart(name, sheet_name, chart_type, { :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :area=>area, :is_vertical=>is_vertical, :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.add_new_chart_to_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update chart propreties
def cells_charts_post_worksheet_chart
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
chart = AsposeCellsCloud::Chart.new
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_post_worksheet_chart(name, sheet_name, chart_index, { :chart=>chart,:folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.cells_charts_post_worksheet_chart
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear the charts.
def clear_the_charts
name = $MYDOC
sheet_name = $SHEET3
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_delete_worksheet_clear_charts(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.clear_the_charts
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet chart by index.
def delete_worksheet_chart_by_index
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_delete_worksheet_delete_chart(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.delete_worksheet_chart_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart area border info.
def get_chart_area_border_info
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_chart_area_get_chart_area_border(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.get_chart_area_border_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart area fill format info.
def get_chart_area_fill_format_info
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_chart_area_get_chart_area_fill_format(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.get_chart_area_fill_format_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart area info.
def get_chart_area_info
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_chart_area_get_chart_area(name, sheet_name, chart_index, { :folder=>folder})
end
end
chart = Chart.new()
puts chart.get_chart_area_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart in specified format.
def get_chart_in_specified_format
name = $MYDOC
sheet_name = $SHEET3
chart_number = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_get_worksheet_chart(name, sheet_name, chart_number, {:format=>format, :folder=>folder})
end
end
chart = Chart.new()
puts chart.get_chart_in_specified_format
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart info.
def get_chart_info
name = $MYDOC
sheet_name = $SHEET3
chart_number = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_get_worksheet_chart(name, sheet_name, chart_number, {:format=>format, :folder=>folder})
end
end
chart = Chart.new()
puts chart.get_chart_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get chart legend
def get_chart_legend
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_get_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.get_chart_legend
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet charts info.
def get_worksheet_charts_info
name = $MYDOC
sheet_name = $SHEET3
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_get_worksheet_charts(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.get_worksheet_charts_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Hide legend in chart
def hide_legend_in_chart
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_delete_worksheet_chart_legend(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.hide_legend_in_chart
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Hide title in chart
def hide_title_in_chart
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_delete_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.hide_title_in_chart
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Show legend in chart
def show_legend_in_chart
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_delete_worksheet_chart_title(name, sheet_name, chart_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.show_legend_in_chart
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update chart legend
def update_chart_legend
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
legend = AsposeCellsCloud::Legend.new
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_post_worksheet_chart_legend(name, sheet_name, chart_index, { :legend=>legend, :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.update_chart_legend
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Chart
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update chart title
def update_chart_title
name = $MYDOC
sheet_name = $SHEET3
chart_index = 0
title = AsposeCellsCloud::Title.new
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_charts_post_worksheet_chart_title(name, sheet_name, chart_index, { :title=>title, :folder=>folder})
expect(result.code).to eql(200)
end
end
chart = Chart.new()
puts chart.update_chart_title
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Copy worksheet columns.
def copy_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
source_column_index = 100
destination_column_index = 100
column_number = 1
worksheet = $SHEET2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_copy_worksheet_columns(name, sheet_name, source_column_index, destination_column_index, column_number, { :worksheet=>worksheet,:folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.copy_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet columns.
def delete_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
column_index = 100
columns = 2
update_reference = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_delete_worksheet_columns(name, sheet_name, column_index, columns, update_reference, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.delete_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Group worksheet columns.
def group_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
first_index = 1
last_index = 4
hide = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_group_worksheet_columns(name, sheet_name, first_index, last_index, { :hide=>hide, :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.group_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Hide worksheet columns.
def hide_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
start_column = 1
total_columns = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_hide_worksheet_columns(name, sheet_name, start_column, total_columns, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.hide_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Insert worksheet columns.
def insert_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
column_index = 100
columns = 2
update_reference = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_put_insert_worksheet_columns(name, sheet_name, column_index, columns, {:update_reference=>update_reference, :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.insert_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet column data by column's index.
def read_worksheet_column_data_by_index
name = $BOOK1
sheet_name = $SHEET1
column_index = 100
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_column(name, sheet_name, column_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.read_worksheet_column_data_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet columns info.
def read_worksheet_columns_info
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_columns(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.read_worksheet_columns_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set column style
def set_column_style
name = $BOOK1
sheet_name = $SHEET1
column_index = 100
style = AsposeCellsCloud::Style.new
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_column_style(name, sheet_name, column_index, { :style=>style, :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.set_column_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set worksheet column width.
def set_worksheet_column_width
name = $BOOK1
sheet_name = $SHEET1
column_index = 100
width = 10
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_set_worksheet_column_width(name, sheet_name, column_index, width, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.set_worksheet_column_width
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Ungroup worksheet columns.
def ungroup_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
first_index = 1
last_index = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_ungroup_worksheet_columns(name, sheet_name, first_index, last_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.ungroup_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Column
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unhide worksheet columns.
def unhide_worksheet_columns
name = $BOOK1
sheet_name = $SHEET1
startcolumn = 1
total_columns = 2
width = 10
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_unhide_worksheet_columns(name, sheet_name, startcolumn, total_columns, { :width=>width, :folder=>folder})
expect(result.code).to eql(200)
end
end
column = Column.new()
puts column.unhide_worksheet_columns
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add worksheet's cell comment.
def add_worksheet_cell_comment
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'C1'
comment = AsposeCellsCloud::Comment.new({:Author=>'Roy'})
folder = $TEMPFOLDER
@instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
@instance.cells_worksheets_put_worksheet_comment(name, sheet_name, cell_name, {:comment=>comment, :folder=>folder})
end
end
comment = Comment.new()
puts comment.add_worksheet_cell_comment
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet's cell comment.
def delete_work_sheet_comments
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_worksheet_comments(name, sheet_name, { :folder=>folder})
end
end
comment = Comment.new()
puts comment.delete_work_sheet_comments
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet's cell comment.
def delete_worksheet_cell_comment
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'C1'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_worksheet_comment(name, sheet_name, cell_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
comment = Comment.new()
puts comment.delete_worksheet_cell_comment
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet comment by cell name.
def get_worksheet_comment_by_cell_name
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_comments(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
comment = Comment.new()
puts comment.get_worksheet_comment_by_cell_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet comments.
def get_worksheet_comments
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_comments(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
comment = Comment.new()
puts comment.get_worksheet_comments
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Comment
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update worksheet's cell comment.
def update_worksheet_cell_comment
name = $BOOK1
sheet_name = $SHEET1
cell_name = 'B3'
comment = AsposeCellsCloud::Comment.new({:Author=>'Roy'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_worksheet_comment(name, sheet_name, cell_name, {:comment=>comment, :folder=>folder})
expect(result.code).to eql(200)
end
end
comment = Comment.new()
puts comment.update_worksheet_cell_comment
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def delete_worksheet_conditional_formatting
name = $BOOK1
sheet_name = $SHEET1
index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_delete_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.delete_worksheet_conditional_formatting
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def delete_worksheet_conditional_formatting_area
name = $BOOK1
sheet_name = $SHEET1
start_row = 1
start_column = 1
total_rows = 4
total_columns = 6
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result =@instance.cells_conditional_formattings_delete_worksheet_conditional_formatting_area(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.delete_worksheet_conditional_formatting_area
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def delete_worksheet_conditional_formattings
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_delete_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.delete_worksheet_conditional_formattings
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def get_worksheet_conditional_formatting
name = $BOOK1
sheet_name = $SHEET1
index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_get_worksheet_conditional_formatting(name, sheet_name, index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.get_worksheet_conditional_formatting
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def get_worksheet_conditional_formattings
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_get_worksheet_conditional_formattings(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.get_worksheet_conditional_formattings
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_format_condition
name = $BOOK1
sheet_name = $SHEET1
index = 0
cell_area = $CELLAREA
type = 'CellValue'
operator_type = 'Between'
formula1 = 'v1'
formula2 = 'v2'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_put_worksheet_format_condition(name, sheet_name, index, cell_area, type, operator_type, formula1, formula2, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.put_worksheet_format_condition
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_format_condition_area
name = $BOOK1
sheet_name = $SHEET1
index = 0
cell_area = $CELLAREA
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_put_worksheet_format_condition_area(name, sheet_name, index, cell_area, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.put_worksheet_format_condition_area
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class ConditionalFormatting
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Clear cells contents.
def put_worksheet_format_condition_condition
name = $BOOK1
sheet_name = $SHEET1
index = 0
type = 'CellValue'
operator_type = 'Between'
formula1 = 'v1'
formula2 = 'v2'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_conditional_formattings_put_worksheet_format_condition_condition(name, sheet_name, index, type, operator_type, formula1, formula2, { :folder=>folder})
expect(result.code).to eql(200)
end
end
conditional_formatting = ConditionalFormatting.new()
puts conditional_formatting.put_worksheet_format_condition_condition
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set/create document property.
def create_document_property
name = $BOOK1
property_name = 'Author'
property = AsposeCellsCloud::CellsDocumentProperty.new({:Name=>'Author',:Value=>'roy'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_properties_put_document_property(name, property_name, { :property=>property, :folder=>folder})
expect(result.code).to eql(201)
end
end
document = Document.new()
puts document.create_document_property
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Decrypt document
def decrypt_document
name = $BOOK1
encryption = AsposeCellsCloud::WorkbookEncryptionRequest.new({:Password=>'123456',:KeyLength=>128,:EncryptionType=>'XOR'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_delete_decrypt_document(name, { :encryption=>encryption,:folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.decrypt_document
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete all custom document properties and clean built-in ones.
def delete_document_properties
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_properties_delete_document_properties(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.delete_document_properties
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete document property.
def delete_document_property
name = $BOOK1
property_name = 'Author'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_properties_delete_document_property(name, property_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.delete_document_property
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Encrypt document.
def encrypt_document
name = $BOOK1
encryption = AsposeCellsCloud::WorkbookEncryptionRequest.new({:Password=>'123456',:KeyLength=>128,:EncryptionType=>'XOR'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result =@instance.cells_workbook_post_encrypt_document(name, {:encryption=>encryption, :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.encrypt_document
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Protect document.
def protect_document
name = $BOOK1
protection = AsposeCellsCloud::WorkbookProtectionRequest.new(:Password=>'123',:ProtectionType=>'All')
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_protect_document(name, { :protection=>protection, :folder=>folder})
end
end
document = Document.new()
puts document.protect_document
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Protect document from changes.
def protect_document_from_changes
name = $BOOK1
password = AsposeCellsCloud::PasswordRequest.new({:Password=>'123456'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_put_document_protect_from_changes(name, {:password=>password, :folder=>folder})
end
end
document = Document.new()
puts document.protect_document_from_changes
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read document properties.
def read_document_properties
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_properties_get_document_properties(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.read_document_properties
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read document property by name.
def read_document_property_by_name
name = $BOOK1
property_name = 'Author'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_properties_get_document_property(name, property_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.read_document_property_by_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unprotect document.
def unprotect_document
name = $BOOK1
protection = AsposeCellsCloud::WorkbookProtectionRequest.new({:Password=>'123',:ProtectionType=>'All'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_delete_unprotect_document(name, {:protection=>protection, :folder=>folder})
end
end
document = Document.new()
puts document.unprotect_document
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Document
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unprotect document from changes.
def unprotect_document_from_changes
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result =@instance.cells_workbook_delete_document_unprotect_from_changes(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
document = Document.new()
puts document.unprotect_document_from_changes
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class ListObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Sort table's data.
def post_sort_table_data
name = $BOOK1
sheet_name = $SHEET7
list_object_index = 0
data_sorter = AsposeCellsCloud::DataSorter.new({:'CaseSensitive'=>true})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_list_objects_post_worksheet_list_object_sort_table(name, sheet_name, list_object_index, {:data_sorter=>data_sorter, :folder=>folder})
expect(result.code).to eql(200)
end
end
listObject = ListObject.new()
puts listObject.post_sort_table_data
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add OLE object
def add_ole_object
name = $BOOK1
sheet_name = $SHEET6
ole_object = nil
upper_left_row = 1
upper_left_column = 1
height = 100
width = 80
ole_file = 'OLEDoc.docx'
image_file = 'word.jpg'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+ole_file, ::File.open(File.expand_path("data/"+ole_file),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+image_file, ::File.open(File.expand_path("data/"+image_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_put_worksheet_ole_object(name, sheet_name, { :ole_object=>ole_object, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :height=>height, :width=>width, :ole_file=> (folder+"/"+ole_file), :image_file=> (folder+"/"+image_file),:folder=>folder})
expect(result.code).to eql(200)
end
end
oleObject = OLEObject.new()
puts oleObject.add_ole_object
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete OLE object
def delete_ole_object
name = $BOOK1
sheet_name = $SHEET6
ole_object_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_delete_worksheet_ole_object(name, sheet_name, ole_object_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
oleObject = OLEObject.new()
puts oleObject.delete_ole_object
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def delete_worksheet_ole_objects
name = $BOOK1
sheet_name = $SHEET6
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_delete_worksheet_ole_objects(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
oleObject = OLEObject.new()
puts oleObject.delete_worksheet_ole_objects
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get OLE object in specified format
def get_ole_object_in_specified_format
name = $BOOK1
sheet_name = $SHEET6
object_number = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_get_worksheet_ole_object(name, sheet_name, object_number, {:format=>format, :folder=>folder})
end
end
oleObject = OLEObject.new()
puts oleObject.get_ole_object_in_specified_format
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get OLE object info.
def get_ole_object_info
name = $BOOK1
sheet_name = $SHEET6
object_number = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_get_worksheet_ole_object(name, sheet_name, object_number, {:format=>format, :folder=>folder})
end
end
oleObject = OLEObject.new()
puts oleObject.get_ole_object_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet OLE objects info.
def get_worksheet_ole_objects_info
name = $BOOK1
sheet_name = $SHEET6
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_get_worksheet_ole_objects(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
oleObject = OLEObject.new()
puts oleObject.get_worksheet_ole_objects_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class OLEObject
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update OLE object.
def update_ole_object
name = $BOOK1
sheet_name = $SHEET6
ole_object_index = 0
ole = AsposeCellsCloud::OleObject.new({:Left=>10,:Right=>10,:Height=>100,:Width=>90})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_ole_objects_post_update_worksheet_ole_object(name, sheet_name, ole_object_index, { :ole=>ole,:folder=>folder})
expect(result.code).to eql(200)
end
end
oleObject = OLEObject.new()
puts oleObject.update_ole_object
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add a new worksheet picture.
def add_a_new_worksheet_picture
name = $BOOK1
sheet_name = $SHEET6
picture = nil
upper_left_row = 1
upper_left_column = 1
lower_right_row = 10
lower_right_column = 10
picture_path = 'WaterMark.png'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+picture_path, ::File.open(File.expand_path("data/"+picture_path),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_put_worksheet_add_picture(name, sheet_name, {:picture=>picture, :upper_left_row=>upper_left_row, :upper_left_column=>upper_left_column, :lower_right_row=>lower_right_row, :lower_right_column=>lower_right_column, :picture_path=>(folder+"/"+picture_path), :folder=>folder})
expect(result.code).to eql(200)
end
end
picture = Picture.new()
puts picture.add_a_new_worksheet_picture
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete a picture object in worksheet
def delete_a_picture_object_in_worksheet
name = $BOOK1
sheet_name = $SHEET6
picture_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_delete_worksheet_picture(name, sheet_name, picture_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
picture = Picture.new()
puts picture.delete_a_picture_object_in_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete all pictures in worksheet.
def delete_all_pictures_in_worksheet
name = $BOOK1
sheet_name = $SHEET6
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_delete_worksheet_pictures(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
picture = Picture.new()
puts picture.delete_all_pictures_in_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet picture by number.
def read_worksheet_picture_by_number
name = $BOOK1
sheet_name = $SHEET6
picture_index = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, {:format=>format, :folder=>folder})
end
end
picture = Picture.new()
puts picture.read_worksheet_picture_by_number
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet picture in specified format
def read_worksheet_picture_in_specified_format
name = $BOOK1
sheet_name = $SHEET6
picture_index = 0
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_get_worksheet_picture(name, sheet_name, picture_index, {:format=>format, :folder=>folder})
end
end
picture = Picture.new()
puts picture.read_worksheet_picture_in_specified_format
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet pictures.
def read_worksheet_pictures
name = $BOOK1
sheet_name = $SHEET6
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_get_worksheet_pictures(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
picture = Picture.new()
puts picture.read_worksheet_pictures
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Picture
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update worksheet picture by index.
def update_worksheet_picture_by_index
name = $BOOK1
sheet_name = $SHEET6
picture_index = 0
picture = AsposeCellsCloud::Picture.new(:AlternativeText=>'AlternativeText')
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pictures_post_worksheet_picture(name, sheet_name, picture_index, {:picture=>picture, :folder=>folder})
expect(result.code).to eql(200)
end
end
picture = Picture.new()
puts picture.update_worksheet_picture_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add a pivot table into worksheet.
def add_a_pivot_table_into_worksheet
name = $PivTestFile
sheet_name = $SHEET4
request = AsposeCellsCloud::CreatePivotTableRequest.new({:Name=>'TestPivot',:DestCellName=>'C1',:SourceData =>'Sheet1!C6:E13',:UseSameSource=>true})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
source_data = 'Sheet1!C6:E13'
dest_cell_name = 'C1'
table_name = 'TestPivot'
use_same_source = true
result = @instance.cells_pivot_tables_put_worksheet_pivot_table(name, sheet_name, { :folder=>folder, :source_data=>source_data, :dest_cell_name=>dest_cell_name, :table_name=>table_name, :use_same_source=>use_same_source})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.add_a_pivot_table_into_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add pivot field into pivot table
def add_pivot_field_into_pivot_table
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
pivot_field_type = 'Row'
request = AsposeCellsCloud::PivotTableFieldRequest.new({:Data=>[1]})
need_re_calculate = nil
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_put_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, {:request=>request, :need_re_calculate=>need_re_calculate, :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.add_pivot_field_into_pivot_table
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Calculates pivottable's data to cells.
def calculate_pivottable_data_to_cells
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_post_worksheet_pivot_table_calculate(name, sheet_name, pivot_table_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.calculate_pivottable_data_to_cells
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete pivot field into pivot table
def delete_pivot_table_field
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
pivot_field_type = 'Row'
request = AsposeCellsCloud::PivotTableFieldRequest.new({:Data=>[1]})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_delete_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_type, { :request=>request,:folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.delete_pivot_table_field
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet pivot table by index
def delete_worksheet_pivot_table_by_index
name = $PivTestFile
sheet_name = $SHEET4
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_delete_worksheet_pivot_tables(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.delete_worksheet_pivot_table_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet pivot tables
def delete_worksheet_pivot_tables
name = $PivTestFile
sheet_name = $SHEET4
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_delete_worksheet_pivot_tables(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.delete_worksheet_pivot_tables
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get pivot field into pivot table
def get_pivot_table_field
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
pivot_field_index = 0
pivot_field_type = 'row'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_get_pivot_table_field(name, sheet_name, pivot_table_index, pivot_field_index, pivot_field_type, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.get_pivot_table_field
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet pivottable info by index.
def get_worksheet_pivot_table_info_by_index
name = $PivTestFile
sheet_name = $SHEET4
pivottable_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_get_worksheet_pivot_table(name, sheet_name, pivottable_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.get_worksheet_pivot_table_info_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet pivottables info.
def get_worksheet_pivot_tables_info
name = $PivTestFile
sheet_name = $SHEET4
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_get_worksheet_pivot_tables(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.get_worksheet_pivot_tables_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update cell style for pivot table
def update_cell_style_for_pivot_table
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
column = 1
row = 1
style = AsposeCellsCloud::Style.new({:Custom=>'p'})
need_re_calculate = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_post_pivot_table_cell_style(name, sheet_name, pivot_table_index, column, row, {:style=>style, :need_re_calculate=>need_re_calculate, :folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.update_cell_style_for_pivot_table
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class PivotTable
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update style for pivot table
def update_style_for_pivot_table
name = $PivTestFile
sheet_name = $SHEET4
pivot_table_index = 0
style = AsposeCellsCloud::Style.new({:Custom=>'p'})
need_re_calculate = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_pivot_tables_post_pivot_table_style(name, sheet_name, pivot_table_index, { :style=>style, :need_re_calculate=>need_re_calculate,:folder=>folder})
expect(result.code).to eql(200)
end
end
pivotTable = PivotTable.new()
puts pivotTable.update_style_for_pivot_table
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Copy worksheet rows.
def copy_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
source_row_index = 100
destination_row_index = 100
row_number = 1
worksheet = $SHEET2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_copy_worksheet_rows(name, sheet_name, source_row_index, destination_row_index, row_number, {:worksheet=>worksheet, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.copy_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet row.
def delete_worksheet_row
name = $BOOK1
sheet_name = $SHEET1
row_index = 100
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_delete_worksheet_row(name, sheet_name, row_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.delete_worksheet_row
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def delete_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
startrow = 1
total_rows = 1
update_reference = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_delete_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference,:folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.delete_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Group worksheet rows.
def group_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
first_index = 1
last_index = 2
hide = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_group_worksheet_rows(name, sheet_name, first_index, last_index, {:hide=>hide, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.group_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Hide worksheet rows.
def hide_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
startrow = 1
total_rows = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_hide_worksheet_rows(name, sheet_name, startrow, total_rows, { :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.hide_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Insert new worksheet row.
def insert_new_worksheet_row
name = $BOOK1
sheet_name = $SHEET1
row_index = 100
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_put_insert_worksheet_row(name, sheet_name, row_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.insert_new_worksheet_row
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Insert several new worksheet rows.
def insert_new_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
startrow = 1
total_rows = 2
update_reference = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_put_insert_worksheet_rows(name, sheet_name, startrow, { :total_rows=>total_rows, :update_reference=>update_reference, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.insert_new_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Read worksheet row data by row&#39;s index.
def read_worksheet_row_data
name = $BOOK1
sheet_name = $SHEET1
row_index = 100
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_row(name, sheet_name, row_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.read_worksheet_row_data
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Read worksheet rows info.
def read_worksheet_rows_info
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_get_worksheet_rows(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.read_worksheet_rows_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set row style.
def set_row_style
name = $BOOK1
sheet_name = $SHEET1
row_index = 100
style = AsposeCellsCloud::Style.new
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_row_style(name, sheet_name, row_index, { :style=>style, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.set_row_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Ungroup worksheet rows.
def ungroup_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
first_index = 1
last_index = 10
is_all = true
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_ungroup_worksheet_rows(name, sheet_name, first_index, last_index, { :is_all=>is_all, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.ungroup_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unhide worksheet rows.
def unhide_worksheet_rows
name = $BOOK1
sheet_name = $SHEET1
startrow = 1
total_rows = 1
height = 10
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_unhide_worksheet_rows(name, sheet_name, startrow, total_rows, {:height=>height, :folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.unhide_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Row
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update worksheet row.
def update_worksheet_row
name = $BOOK1
sheet_name = $SHEET1
row_index = 100
height = 10
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_update_worksheet_row(name, sheet_name, row_index, { :height=>height,:folder=>folder})
expect(result.code).to eql(200)
end
end
row = Row.new()
puts row.update_worksheet_row
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Autofit workbook rows.
def autofit_workbook_rows
name = $BOOK1
auto_fitter_options = nil
start_row = 1
end_row = 100
only_auto = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_autofit_workbook_rows(name, {:auto_fitter_options=>auto_fitter_options, :start_row=>start_row, :end_row=>end_row, :only_auto=>only_auto, :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.autofit_workbook_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Calculate all formulas in workbook.
def calculate_all_formulas_in_workbook
name = $BOOK1
options = AsposeCellsCloud::CalculationOptions.new({:IgnoreError=>true})
ignore_error = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_calculate_formula(name, { :options=>options, :ignore_error=>ignore_error,:folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.calculate_all_formulas_in_workbook
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert document and save result to storage.
def convert_document_and_save_result_to_storage
name = $BOOK1
save_options = nil
newfilename = 'newbook.xlsx'
is_auto_fit_rows = true
is_auto_fit_columns = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>(folder+"/"+newfilename), :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.convert_document_and_save_result_to_storage
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert Excel Workbook to Different File Formats.
def convert_excel_workbook_to_different_file_formats
name = $BOOK1
password = nil
format = 'XPS'
is_auto_fit = true
only_save_table = true
folder = $TEMPFOLDER
out_path = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path})
end
end
workbook = Workbook.new()
puts workbook.convert_excel_workbook_to_different_file_formats
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert workbook from request content to some format.
def convert_workbook_from_request_content
name = $BOOK1
format = 'pdf'
password = nil
out_path = "Tdd.pdf"
result = @instance.cells_workbook_put_convert_workbook( ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
end
end
workbook = Workbook.new()
puts workbook.convert_workbook_from_request_content
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Create new workbook using different methods.
def create_new_workbook
t = Time.now
name = Time.now.strftime("%y%m%d%H%M%s") + $BOOK1
template_file = $BOOK1
data_file = 'ReportData.xml'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+template_file, ::File.open(File.expand_path("data/"+template_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.upload_file(folder+"/"+data_file, ::File.open(File.expand_path("data/"+data_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_put_workbook_create(name, {:template_file=>folder+"/"+template_file, :data_file=>folder+"/"+data_file, :folder=>folder})
end
end
workbook = Workbook.new()
puts workbook.put_workbook_create
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def get_workbook_settings
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook_settings(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.get_workbook_settings
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Import data to workbook.
def import_data_to_workbook
name = $BOOK1
importdata = AsposeCellsCloud::ImportIntArrayOption.new({:DestinationWorksheet=>$SHEET1,:FirstColumn=>1,:FirstRow=>3,:ImportDataType=>'IntArray',:IsVertical=>true,:Data=>[1,2,3,4]})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_import_data(name, importdata, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.import_data_to_workbook
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Merge workbooks.
def merge_workbooks
name = $BOOK1
merge_with = 'myDocument.xlsx'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+merge_with, ::File.open(File.expand_path("data/"+merge_with),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbooks_merge(name,(folder+"/"+ merge_with), { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.merge_workbooks
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert document and save result to storage.
def post_document_save_as
name = $BOOK1
save_options = nil
newfilename = 'newbook.xlsx'
is_auto_fit_rows = true
is_auto_fit_columns = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>(folder+"/"+newfilename), :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.post_document_save_as
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Import data to workbook.
def post_import_data
import_batch_data_option = ImportBatchDataOption.new
import_batch_data_option.destination_worksheet = "Sheet1"
import_batch_data_option.is_insert = false
import_batch_data_option.import_data_type = "BatchData"
import_source = ImportSource.new
import_source.file_source_type = "CloudFileSystem"
import_source.file_path = "Batch_data_json.txt"
import_batch_data_option.source = import_source
import_string_array_option = ImportStringArrayOption.new
import_string_array_option.first_row = 1
import_string_array_option.first_column = 2
import_string_array_option.is_vertical = true
import_string_array_option.destination_worksheet = "Sheet1"
import_string_array_option.is_insert = true
import_string_array_option.import_data_type = "StringArray"
import_source = ImportSource.new
import_source.file_source_type = "CloudFileSystem"
import_source.file_path = "Array_string_json.txt"
import_string_array_option.source = import_source
import_int_array_option = ImportIntArrayOption.new
import_int_array_option.first_row = 1
import_int_array_option.first_column = 2
import_int_array_option.is_vertical = true
import_int_array_option.destination_worksheet = "Sheet1"
import_int_array_option.is_insert = true
import_int_array_option.import_data_type = "IntArray"
import_source = ImportSource.new
import_source.file_source_type = "CloudFileSystem"
import_source.file_path = "Array_int_json.txt"
import_int_array_option.source = import_source
import_double_array_option = ImportDoubleArrayOption.new
import_double_array_option.first_row = 1
import_double_array_option.first_column = 2
import_double_array_option.is_vertical = true
import_double_array_option.destination_worksheet = "Sheet1"
import_double_array_option.is_insert = true
import_double_array_option.import_data_type = "DoubleArray"
import_source = ImportSource.new
import_source.file_source_type = "CloudFileSystem"
import_source.file_path = "Array_double_json.txt"
import_double_array_option.source = import_source
import_data_options = [import_batch_data_option, import_string_array_option, import_int_array_option, import_double_array_option]
data_files = ["Batch_data_json.txt", "Array_string_json.txt", "Array_int_json.txt", "Array_double_json.txt"]
import_data_options.each_with_index { |option, index|
data_file = data_files.at(index)
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.upload_file( folder+"/"+data_file, ::File.open(File.expand_path("data/"+data_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
response = @cells_api.cells_workbook_post_import_data(file_name, option,{ :folder=>folder})
expect(response.code).to eql(200)
}
end
end
workbook = Workbook.new()
puts workbook.post_import_data
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Import data to workbook.
def post_import_data_without_using_storage
name = $BOOK1
importdata = AsposeCellsCloud::ImportIntArrayOption.new({:DestinationWorksheet=>$SHEET1,:FirstColumn=>1,:FirstRow=>3,:ImportDataType=>'IntArray',:IsVertical=>true,:Data=>[1,2,3,4]})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_import_data(name, importdata, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.post_import_data_without_using_storage
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def post_run_task
param1 = AsposeCellsCloud::SplitWorkbookTaskParameter.new({:DestinationFileFormat=>'xlsx' ,:DestinationFilePosition=> AsposeCellsCloud::FileSource.new({:FileSourceType=>'CloudFileSystem'}),:SplitNameRule=>'sheetname',:Workbook=>AsposeCellsCloud::FileSource.new({:FilePath=>$TEMPFOLDER +'\\' + $BOOK1,:FileSourceType=>'CloudFileSystem'})})
task1 =AsposeCellsCloud::TaskDescription.new({:TaskType=>'SplitWorkbook',:TaskParameter=>param1})
task_data = AsposeCellsCloud::TaskData.new(:Tasks=>[task1])
result = @instance.cells_task_post_run_task(task_data)
expect(result).not_to be_empty
end
end
workbook = Workbook.new()
puts workbook.post_run_task
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def post_workbook_calculate_formula
name = $BOOK1
options = AsposeCellsCloud::CalculationOptions.new({:IgnoreError=>true})
ignore_error = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_calculate_formula(name, { :options=>options, :ignore_error=>ignore_error,:folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.post_workbook_calculate_formula
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert workbook from request content to some format.
def put_convert_work_book
name = $BOOK1
format = 'pdf'
password = nil
out_path = "Tdd.pdf"
result = @instance.cells_workbook_put_convert_workbook( ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
end
end
workbook = Workbook.new()
puts workbook.put_convert_work_book
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert workbook from request content to some format.
def put_convert_work_book_with_additional_settings
name = $BOOK1
format = 'pdf'
password = nil
out_path = "Tdd.pdf"
result = @instance.cells_workbook_put_convert_workbook( ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) },{:format=>format,out_path=>out_path})
end
end
workbook = Workbook.new()
puts workbook.put_convert_work_book_with_additional_settings
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read workbook default style info.
def read_workbook_default_style_info
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook_default_style(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.read_workbook_default_style_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read workbook info or export.
def read_workbook_info
name = $BOOK1
password = nil
format = 'XPS'
is_auto_fit = true
only_save_table = true
folder = $TEMPFOLDER
out_path = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook(name, { :password=>password, :format=>format,:folder=>folder, :out_path=>out_path})
end
end
workbook = Workbook.new()
puts workbook.read_workbook_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read workbook&#39;s name.
def read_workbook_name
name = $BOOK1
name_name = 'Name_2'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook_name(name, name_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.read_workbook_name
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read workbook&#39;s names.
def read_workbook_names
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook_names(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.read_workbook_names
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read workbook&#39;s text items.
def read_workbook_text_items
name = $BOOK1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_get_workbook_text_items(name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.read_workbook_text_items
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Replace text.
def replace_text
name = $BOOK1
old_value = '!22'
new_value = '22'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbooks_text_replace(name, old_value, new_value, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.replace_text
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Search text.
def search_text
name = $BOOK1
text = 'test'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbooks_text_search(name, text, { :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.search_text
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Smart marker processing result.
def smart_marker_processing_result
name = $BOOK1
xml_file = 'ReportData.xml'
folder = $TEMPFOLDER
out_path = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
result = @instance.upload_file( folder+"/"+xml_file, ::File.open(File.expand_path("data/"+xml_file),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_get_smart_marker_result(name, { :xml_file=>(folder+"/"+xml_file),:folder=>folder})
end
end
workbook = Workbook.new()
puts workbook.smart_marker_processing_result
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Split workbook.
def split_workbook
name = $BOOK1
format = 'png'
from = 1
to = 3
horizontal_resolution = 100
vertical_resolution = 90
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_split(name, { :format=>format, :from=>from, :to=>to, :horizontal_resolution=>horizontal_resolution, :vertical_resolution=>vertical_resolution,:folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.split_workbook
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Workbook
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def update_workbook_settings
name = $BOOK1
settings = AsposeCellsCloud::WorkbookSettings.new(:AutoCompressPictures=>true)
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_workbook_post_workbook_settings(name, {:settings=>settings, :folder=>folder})
expect(result.code).to eql(200)
end
end
workbook = Workbook.new()
puts workbook.update_workbook_settings
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add new worksheet.
def add_new_worksheet
name = $BOOK1
sheet_name = $SHEET1
position = 1
sheettype = 'VB'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_put_add_new_worksheet(name, sheet_name, {:position=>position, :sheettype=>sheettype, :folder=>folder})
expect(result.code).to eql(201)
end
end
worksheet = Worksheet.new()
puts worksheet.add_new_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Add worksheet validation at index.
def add_worksheet_validation_at_index
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheet_validations_put_worksheet_validation(name, sheet_name, {:range=>range, :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.add_worksheet_validation_at_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Autofit worksheet rows.
def autofit_worksheet_rows
file_name = "myWorkbook.xlsx"
upload_file(file_name)
sheet_name = "Sheet1"
auto_fitter_options = AutoFitterOptions.new
auto_fitter_options.auto_fit_merged_cells = true
auto_fitter_options.ignore_hidden = true
auto_fitter_options.only_auto = true
response = @cells_api.post_autofit_worksheet_rows(file_name, sheet_name, auto_fitter_options, {startRow: 1, endRow: 10, onlyAuto: true})
end
end
worksheet = Worksheet.new()
puts worksheet.autofit_worksheet_rows
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Calculate formula value.
def calculate_formula_value
name = $BOOK1
sheet_name = $SHEET1
formula = '=NOW()'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_calculate_formula(name, sheet_name, formula, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.calculate_formula_value
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Change worksheet visibility.
def change_worksheet_visibility
name = $BOOK1
sheet_name = $SHEET1
is_visible = true
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_put_change_visibility_worksheet(name, sheet_name, is_visible, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.change_worksheet_visibility
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Convert autoshape to Different File Formats.
def convert_autoshape_to_different_file_formats
name = $MYDOC
sheet_name = $SHEET2
autoshape_number = 4
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_autoshapes_get_worksheet_autoshape(name, sheet_name, autoshape_number, { :format=>format,:folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.convert_autoshape_to_different_file_formats
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Copy worksheet
def copy_worksheet
name = 'NewCopy.xlsx'
sheet_name = $SHEET5
source_sheet = $SHEET6
options = AsposeCellsCloud::CopyOptions.new({:ColumnCharacterWidth=>true})
source_workbook = $BOOK1
source_folder = $TEMPFOLDER
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.upload_file( folder+"/"+source_workbook, ::File.open(File.expand_path("data/"+source_workbook),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_copy_worksheet(name, sheet_name, source_sheet,{ :options=>options, :source_workbook=>source_workbook, :source_folder=>source_folder,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.copy_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def delete_work_sheet_background
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_worksheet_background(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.delete_work_sheet_background
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def delete_worksheet
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_worksheet(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.delete_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Delete worksheet validation by index.
def delete_worksheet_validation_by_index
name = $BOOK1
sheet_name = $SHEET1
validation_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheet_validations_delete_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.delete_worksheet_validation_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
AsposeApp.app_key_and_sid("da77c9f5da014d91faf2961ecec2de66", "B01A15E5-1B83-4B9A-8EB3-0F2BFA6AC766")
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Extract barcodes from worksheet picture.
def extract_barcodes_from_worksheet_picture
file_name = "Sample_Test_Book.xls"
upload_file(file_name)
sheet_name = "Sheet6"
picture_number = 0
response = @cells_api.get_extract_barcodes(file_name, sheet_name, picture_number)
end
end
worksheet = Worksheet.new()
puts worksheet.extract_barcodes_from_worksheet_picture
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get autoshape info.
def get_autoshape_info
name = $MYDOC
sheet_name = $SHEET2
autoshape_number = 4
format = 'PNG'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_autoshapes_get_worksheet_autoshape(name, sheet_name, autoshape_number, { :format=>format,:folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.get_autoshape_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet autoshapes info.
def get_worksheet_autoshapes_info
name = $MYDOC
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_autoshapes_get_worksheet_autoshapes(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.get_worksheet_autoshapes
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet text items.
def get_worksheet_text_items
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet_text_items(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.get_worksheet_text_items
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
AsposeApp.app_key_and_sid("da77c9f5da014d91faf2961ecec2de66", "B01A15E5-1B83-4B9A-8EB3-0F2BFA6AC766")
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
def upload_file(file_name)
response = @cells_api.put_create(file_name, File.open("../../../data/" << file_name,"r") { |io| io.read } )
end
# Get worksheet validation by index.
def get_worksheet_validation_by_index
name = $BOOK1
sheet_name = $SHEET1
validation_index = 0
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheet_validations_get_worksheet_validation(name, sheet_name, validation_index, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.get_worksheet_validation_by_index
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Get worksheet validations.
def get_worksheet_validations
name = $BOOK1
sheet_name = $SHEET1
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheet_validations_get_worksheet_validations(name, sheet_name, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.get_worksheet_validations
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Merge cells.
def merge_cells
name = $BOOK1
sheet_name = $SHEET1
start_row = 1
start_column = 1
total_rows = 2
total_columns = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_worksheet_merge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.merge_cells
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Move worksheet.
def move_worksheet
name = $BOOK1
sheet_name = $SHEET1
moving = AsposeCellsCloud::WorksheetMovingRequest.new({:DestinationWorksheet=>$SHEET3,:Position=>'after'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_move_worksheet(name, sheet_name, { :moving=>moving,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.move_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Copy worksheet
def post_copy_worksheet
name = 'NewCopy.xlsx'
sheet_name = $SHEET5
source_sheet = $SHEET6
options = AsposeCellsCloud::CopyOptions.new({:ColumnCharacterWidth=>true})
source_workbook = $BOOK1
source_folder = $TEMPFOLDER
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.upload_file( folder+"/"+source_workbook, ::File.open(File.expand_path("data/"+source_workbook),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_copy_worksheet(name, sheet_name, source_sheet,{ :options=>options, :source_workbook=>source_workbook, :source_folder=>source_folder,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.post_copy_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Protect worksheet.
def protect_worksheet
name = $BOOK1
sheet_name = $SHEET1
protect_parameter = AsposeCellsCloud::ProtectSheetParameter.new({:ProtectionType=>'All',:Password=>'123456'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_put_protect_worksheet(name, sheet_name, { :protect_parameter=>protect_parameter,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.protect_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet in specified format
def read_worksheet_in_specified_format
name = $BOOK1
sheet_name = $SHEET1
format = 'PNG'
vertical_resolution = 100
horizontal_resolution = 90
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet(name, sheet_name, {:format=>format, :vertical_resolution=>vertical_resolution, :horizontal_resolution=>horizontal_resolution, :folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.read_worksheet_in_specified_format
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheet info or export.
def read_worksheet_info
name = $BOOK1
sheet_name = $SHEET1
format = null
vertical_resolution = 100
horizontal_resolution = 90
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet(name, sheet_name, {:format=>format, :vertical_resolution=>vertical_resolution, :horizontal_resolution=>horizontal_resolution, :folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.read_worksheet_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
#Get client_id and client_secret from https://cloud.aspose.com
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Read worksheets info.
def read_worksheets_info
name = $BOOK1
sheet_name = $SHEET1
format = 'PNG'
vertical_resolution = 100
horizontal_resolution = 90
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_get_worksheet(name, sheet_name, {:format=>format, :vertical_resolution=>vertical_resolution, :horizontal_resolution=>horizontal_resolution, :folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.read_worksheets_info
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Rename worksheet
def rename_worksheet
name = $BOOK1
sheet_name = $SHEET1
newname = 'renametest'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_rename_worksheet(name, sheet_name, newname, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.rename_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Replace text.
def replace_text
name = $BOOK1
sheet_name = $SHEET1
old_value = '123'
new_value = '123456'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_worsheet_text_replace(name, sheet_name, old_value, new_value, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.replace_text
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Search text.
def search_text
name = $BOOK1
sheet_name = $SHEET1
text = '123456'
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_worksheet_text_search(name, sheet_name, text, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.search_text
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set freeze panes
def set_freeze_panes
name = $BOOK1
sheet_name = $SHEET1
row = 1
column = 1
freezed_rows = 10
freezed_columns = 10
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_put_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.set_freeze_panes
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Set worksheet background image.
def set_worksheet_background_image
name = $BOOK1
sheet_name = $SHEET1
aFile = File.new(File.expand_path("data/WaterMark.png"),"r")
png = aFile.sysread(aFile.size)
aFile.close
folder = $TEMPFOLDER
result = @instance.delete_file( folder+"/"+name)
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_put_worksheet_background(name, sheet_name, png, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.set_worksheet_background_image
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Sort worksheet range.
def sort_worksheet_range
name = $BOOK1
sheet_name = $SHEET1
cell_area = $CELLAREA
data_sorter = AsposeCellsCloud::DataSorter.new(:CaseSensitive=>true)
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_worksheet_range_sort(name, sheet_name, cell_area, {:data_sorter=>data_sorter, :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.sort_worksheet_range
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unfreeze panes
def unfreeze_panes
name = $BOOK1
sheet_name = $SHEET1
row = 1
column = 1
freezed_rows = 2
freezed_columns = 2
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_worksheet_freeze_panes(name, sheet_name, row, column, freezed_rows, freezed_columns, { :folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.unfreeze_panes
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unmerge cells.
def unmerge_cells
name = $BOOK1
sheet_name = $SHEET1
start_row = 1
start_column = 1
total_rows = 2
total_columns = 2
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_worksheet_unmerge(name, sheet_name, start_row, start_column, total_rows, total_columns, { :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.unmerge_cells
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Unprotect worksheet.
def unprotect_worksheet
name = $BOOK1
sheet_name = $SHEET1
protect_parameter = AsposeCellsCloud::ProtectSheetParameter.new({:Password=>'123456',:ProtectionType=>'All'})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_delete_unprotect_worksheet(name, sheet_name, {:protect_parameter=>protect_parameter, :folder=>folder})
end
end
worksheet = Worksheet.new()
puts worksheet.unprotect_worksheet
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update cell's range style.
def update_cell_range_style
name = $BOOK1
sheet_name = $SHEET1
range = $RANGE
style = AsposeCellsCloud::Style.new
folder = $TEMPFOLDER
storage = nil
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_post_update_worksheet_range_style(name, sheet_name, range,{ :style=>style, :folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.update_cell_range_style
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update worksheet property
def update_worksheet_property
name = $BOOK1
sheet_name = $SHEET1
sheet = AsposeCellsCloud::Worksheet.new({:IsGridlinesVisible=>true})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheets_post_update_worksheet_property(name, sheet_name, { :sheet=>sheet,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.update_worksheet_property
# For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby
require 'aspose_cells_cloud'
class Worksheet
include AsposeCellsCloud
def initialize
@instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,$api_version,$baseurl)
end
# Update worksheet validation by index.
def update_worksheet_validation_by_index
name = $BOOK1
sheet_name = $SHEET1
validation_index = 0
validation = AsposeCellsCloud::Validation.new({:IgnoreBlank=>true})
folder = $TEMPFOLDER
result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) })
expect(result.uploaded.size).to be > 0
result = @instance.cells_worksheet_validations_post_worksheet_validation(name, sheet_name, validation_index, { :validation=>validation,:folder=>folder})
expect(result.code).to eql(200)
end
end
worksheet = Worksheet.new()
puts worksheet.update_worksheet_validation_by_index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment