void test_write_auto_filter() { xlnt::workbook wb; auto ws = wb.get_sheet_by_index(0); ws.get_cell("F42").set_value("hello"); ws.auto_filter("A1:F1"); auto content = xlnt::writer::write_worksheet(ws, {"hello"}, {}); TS_ASSERT(Helper::EqualsFileContent(PathHelper::GetDataDirectory() + "/writer/expected/sheet1_auto_filter.xml", content)); content = xlnt::writer::write_workbook(wb); TS_ASSERT(Helper::EqualsFileContent(PathHelper::GetDataDirectory() + "/writer/expected/workbook_auto_filter.xml", content)); }
void test_write_auto_filter() { xlnt::workbook wb; auto ws = wb.create_sheet(); ws.get_cell("F42").set_value("hello"); ws.auto_filter("A1:F1"); xlnt::workbook_serializer serializer(wb); auto observed = serializer.write_workbook(); auto diff = Helper::compare_xml(PathHelper::read_file("workbook_auto_filter.xml"), observed); TS_ASSERT(!diff); }
void worksheet::auto_filter(const xlnt::range &range) { auto_filter(range.get_reference()); }
void worksheet::auto_filter(const std::string &reference_string) { auto_filter(range_reference(reference_string)); }