class

Crexcel::Worksheet

Inherits Reference < Object

TODO Write doc for Worksheet class

Constants

SUPPORTED_TYPES = {"string" => "s", "int" => "n"}

Instance methods

get(pos_x : Int32 | Int64, pos_y : Int32 | Int64)

Fetch the data at the given x, y postition

first_worksheet = workbook.add_worksheet
first_worksheet.write(0, 0, "hello") # Will write "hello" in A1 cell
first_worksheet.get(0, 0)            # => {pos: "A1", value: "hello", type: ""}
Source
get(position : String) : Datum

Fetch the data at the given string postition

first_worksheet = workbook.add_worksheet
first_worksheet.write(0, 0, "hello") # Will write "hello" in A1 cell
first_worksheet.get("A1")            # => {pos: "A1", value: "hello", type: ""}
Source
name

Get name of the worksheet

Source
write(position : String, str : Int32 | Int64 | Float64 | String, type_req : String)

Write data in the specified worksheet at specific location You can precise the type you want

first_worksheet = workbook.add_worksheet
first_worksheet.write("A1", "1337", "int") # Will write 1337 as a number

Available types are for now : string, int

Source
write(pos_x : Int32 | Int64, pos_y : Int32 | Int64, str : Int32 | Int64 | Float64 | String, type_req = "")

Same as other write methods, but location is precised differently

first_worksheet = workbook.add_worksheet
first_worksheet.write(0, 0, "hello") # Will write "hello" in A1 cell
Source
write(position : String, str : Int32 | Int64 | Float64 | String)

Write data in the specified worksheet at specific location

first_worksheet = workbook.add_worksheet
first_worksheet.write("A1", "Hello world!")
first_worksheet.write("A2", "1337") # Will write 1337 as a string
first_worksheet.write("B1", 1337)   # Will write 1337 as a number
Source
write_row(pos_y : Int32 | Int64, data : Array(Int32 | Int64 | Float64 | String))

Will write a row with the provided array of data

first_worksheet = workbook.add_worksheet
first_worksheet.write_row(0, ["hello", "world"]) # Will write "hello" in A1 cell and "world" in A2
Source
write_row(row : String, data : Array(Int32 | Int64 | Float64 | String))

Will write a row with the provided array of data

first_worksheet = workbook.add_worksheet
first_worksheet.write_row("A", ["hello", "world"]) # Will write "hello" in A1 cell and "world" in A2
Source

Nested types