
Aspose.Cells Cloud SDK for Ruby
Ruby REST API to Create & Convert Excel Spreadsheets
A powerful Ruby REST API to Create, Modify, Render, View, Manipulate & Convert Microsoft Excel & OpenOffice Spreadsheets in the cloud.
What is Aspose.Cells Cloud SDK for Ruby?
For developers seeking a streamlined cloud Ruby spreadsheet SDK, the Aspose.Cells Cloud SDK for Ruby delivers a comprehensive solution for all spreadsheet tasks directly via its robust REST API. This powerful toolkit empowers users to programmatically create spreadsheet via Ruby API, efficiently manage data, and seamlessly convert Microsoft Excel files across a vast array of formats—including XLSX, ODS (OpenOffice spreadsheets), CSV, PDF, and many others. Its intuitive interface facilitates not only core operations like workbook creation and worksheet manipulation but also advanced functionalities such as inserting charts, applying formulas, and managing hyperlinks, all executed without any dependency on Microsoft Office.
Built upon the foundation of the Aspose.Cells Cloud REST API, this SDK excels in automating and customizing spreadsheet workflows. Key features enable users to apply auto-filters and sophisticated list filters, customize headers and footers, and handle rows or columns by splitting or merging them. Beyond editing, it ensures document integrity through encryption and digital signatures while offering precise control to find text or manage images within worksheets. Ultimately, whether the task is to convert Microsoft Excel files, manipulate OpenOffice spreadsheets, or automate complex reporting, this flexible Ruby XLSX REST API provides the essential tools for dynamic, cloud-based spreadsheet generation and management.
Getting Started with Aspose.Cells Cloud SDK for Ruby
The recommend way to install Aspose.Cells Cloud SDK for Ruby is using RubyGem. Please use the following command for a smooth installation.
Install Aspose.Cells Cloud SDK for Ruby via RubyGem
gem install aspose_cells_cloud You can also download it directly from Aspose product release page.Add & Manage Charts in Spreadsheet via Ruby API
Aspose.Cells Cloud SDK for Ruby has included complete support for working with Excel charts inside their own cloud applications. It allows the creation of various types of charts, such as bar charts, line charts, pie charts, and more. The library has included some useful features for handling charts in Microsoft Excel Worksheets, such as adding charts to worksheets, editing existing charts, manipulating charts, customizing the appearance of charts, deleting unwanted charts, converting chart to image, showing/hidding charts legends, get chart value, get chart axis, update chart properties and many more.
How to Add Charts in a Excel Worksheet via Ruby API?
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
Manage Shapes in Excel Spreadsheet via Ruby
Aspose.Cells Cloud SDK for Ruby has provided complete support for handling shapes inside Microsoft Excel Worksheets using Ruby REST API. There are several important features part of the library that makes the developer's job easy while working with Excel shapes, such as adding new shapes to Excel Worksheet, modifying properties of an existing shape, getting all shapes from a worksheet, getting a shape by Index inside on an Excel worksheet, delete all shapes on an Excel worksheet, convert a shape to image on an Excel worksheet and many more.
How to Convert shape to image via Ruby API?
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
Excel Worksheet Handling via Ruby API
Aspose.Cells Cloud SDK for Ruby makes it easy for software developers to work with Excel worksheets inside their own Ruby cloud applications. There are several important features part of the library for handling worksheets, such as adding new Excel worksheets, getting worksheets in different file formats, adding worksheet backgrounds, sorting Excel worksheet data, hiding/unhiding Excel worksheets, sorting worksheet data, moving Excel worksheets, modify worksheet properties, freeze worksheet panes, autofit an Excel workbook, copy Excel worksheet, and many more. The following example shows how to copy contents and formats from another worksheet in the cloud inside Ruby applications.
How to Copy Excel Worksheet Formats via Ruby API?
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
Excel Worksheet Conversion via Ruby Excel API
Aspose.Cells Cloud SDK for Ruby has included complete support for Excel Worksheet Conversion to numerous popular file formats inside their own Ruby applications in the cloud. The library allows developers to import or export some popular Excel file formats, such as XLS, XLSX, XLSB, CSV, TSV, XLSM, ODS, TXT, and many more. It is also possible to convert from Excel file formats to some other popular formats, such as PDF, OTS, XPS, DIF, PNG, JPEG, BMP, SVG, TIFF, EMF, NUMBERS, FODS, and many more. The following example demonstrates how to convert Excel spreadsheets to other supported file formats inside Ruby applications.
How to Convert Excel File and Save Result to Storage via Ruby API?
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
