3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/asposecellsjava/helloworld.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
workbook = Rjb::import('com.aspose.cells.Workbook').new
sheet = workbook.getWorksheets().get(0)
cell = sheet.getCells().get("A1")
cell.setValue("Hello World!")
file_format_type = Rjb::import('com.aspose.cells.FileFormatType')
workbook.save(data_dir + "HelloWorld.xls", file_format_type.EXCEL_97_TO_2003)
puts "Document has been saved, please check the output file."
end
|