Struct xl::Worksheet [−][src]
Expand description
The Worksheet is the primary object in this module since this is where most of the valuable data is. See the methods below for how to use.
Fields
name: String
position: u8
Implementations
Create a new worksheet. Note that this method will probably not be called directly.
Instead, you’ll normally get a worksheet from a Workbook
object. E.g.,:
use xl::{Workbook, Worksheet}; let mut wb = Workbook::open("tests/data/Book1.xlsx").unwrap(); let sheets = wb.sheets(); let ws = sheets.get("Time"); assert!(ws.is_some());
Obtain a RowIter
for this worksheet (that is in workbook
). This is, arguably, the main
part of the library. You use this method to iterate through all the values in this sheet.
The simplest thing you can do is print the values out (which is what xlcat
does), but you
could do more if you wanted.
Example usage
use xl::{Workbook, Worksheet, ExcelValue}; let mut wb = Workbook::open("tests/data/Book1.xlsx").unwrap(); let sheets = wb.sheets(); let ws = sheets.get("Sheet1").unwrap(); let mut rows = ws.rows(&mut wb); let row1 = rows.next().unwrap(); assert_eq!(row1[0].raw_value, "1"); assert_eq!(row1[1].value, ExcelValue::Number(2f64));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Worksheet
impl UnwindSafe for Worksheet