Function write

Source
pub fn write<P: AsRef<Path>>(
    spreadsheet: &Spreadsheet,
    path: P,
    option: Option<&CsvWriterOption>,
) -> Result<(), XlsxError>
Expand description

write spreadsheet file.

§Arguments

  • spreadsheet - Spreadsheet structs object.
  • path - file path to save.
  • option - options.

§Return value

  • Result - OK is void. Err is error message.

§Examples

use umya_spreadsheet::*;
let mut book = new_file();
let path = std::path::Path::new("./tests/result_files/zzz.xlsx");
let mut option = structs::CsvWriterOption::default();
option.set_csv_encode_value(structs::CsvEncodeValues::ShiftJis);
option.set_do_trim(true);
option.set_wrap_with_char("\"");
let _ = writer::csv::write(&book, path, Some(&option));