class Crexcel::Worksheet
- Crexcel::Worksheet
- Reference
- Object
Overview
TODO Write doc for Worksheet class
Defined in:
crexcel/worksheet.crConstant Summary
-
SUPPORTED_TYPES =
{"string" => "s", "int" => "n"}
Instance Method Summary
-
#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: ""}
-
#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: ""}
-
#name : String
Get name of the worksheet
-
#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
-
#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
-
#write(position : String, str : Int32 | Int64 | Float64 | String)
Write data in the specified worksheet at specific location
-
#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
-
#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
Instance Method Detail
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: ""}
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: ""}
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
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
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
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
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