File tree Expand file tree Collapse file tree 5 files changed +34
-6
lines changed
Plugins/Aspose_Cells_Java_for_Ruby Expand file tree Collapse file tree 5 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 1- # Aspose_Cells_Java_For_Ruby
1+ # Aspose_Cells_Java_for_Ruby
22Aspose Cells Java for Ruby is a gem that demonstrates / provides the Aspose.Cells for Java API usage examples in Ruby by using Rjb - Ruby Java Bridge.
33
44## Installation
@@ -23,14 +23,14 @@ http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/
2323
2424For most complete documentation of the project, check Aspose.Cells Java for Ruby confluence wiki link:
2525
26- http://www.aspose.com/docs/display/cellssjava/3 .+Aspose.Cells+Java+For+Ruby
26+ http://www.aspose.com/docs/display/cellsjava/4 .+Aspose.Cells+Java+For+Ruby
2727
2828## Usage
2929
3030``` ruby
31- require ' .. /lib/asposecellsjava'
31+ require require File .dirname( File .dirname( File .dirname( __FILE__ ))) + ' /lib/asposecellsjava'
3232include Asposecellsjava
33- include Asposecellsjava ::HideUnhideWorksheet
33+ include Asposecellsjava ::HelloWorld
3434initialize_aspose_cells
3535```
3636Lets understand the above code
Original file line number Diff line number Diff line change 1+ require_relative 'helloworld'
12require_relative 'hideunhideworksheet'
23require_relative 'displayhidetabs'
34require_relative 'displayhidescrollbars'
Original file line number Diff line number Diff line change 1+ module Asposecellsjava
2+ module HelloWorld
3+ def initialize ( )
4+ data_dir = File . dirname ( File . dirname ( File . dirname ( __FILE__ ) ) ) + '/data/'
5+
6+ # Instantiating a Workbook object that represents a Microsoft Excel file.
7+ workbook = Rjb ::import ( 'com.aspose.cells.Workbook' ) . new
8+
9+ # Note when you create a new workbook, a default worksheet,
10+ # "Sheet1", is by default added to the workbook.
11+ # Accessing the first worksheet in the book ("Sheet1").
12+ sheet = workbook . getWorksheets ( ) . get ( 0 )
13+
14+ # Access cell "A1" in the sheet.
15+ cell = sheet . getCells ( ) . get ( "A1" )
16+
17+ # Input the "Hello World!" text into the "A1" cell
18+ cell . setValue ( "Hello World!" )
19+
20+ # Saving the modified Excel file in default (that is Excel 2003) format
21+ file_format_type = Rjb ::import ( 'com.aspose.cells.FileFormatType' )
22+ workbook . save ( data_dir + "HelloWorld.xls" , file_format_type . EXCEL_97_TO_2003 )
23+
24+ puts "Document has been saved, please check the output file."
25+ end
26+ end
27+ end
Original file line number Diff line number Diff line change 11module Asposecellsjava
2- VERSION = '0.0.1 '
2+ VERSION = '0.0.2 '
33end
Original file line number Diff line number Diff line change 11require '../lib/asposecellsjava'
22include Asposecellsjava
3- include Asposecellsjava ::HideUnhideWorksheet
3+ include Asposecellsjava ::HelloWorld
44
55initialize_aspose_cells
66
You can’t perform that action at this time.
0 commit comments