Beispiel #1
0
    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));
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
void worksheet::auto_filter(const xlnt::range &range)
{
    auto_filter(range.get_reference());
}
Beispiel #4
0
void worksheet::auto_filter(const std::string &reference_string)
{
    auto_filter(range_reference(reference_string));
}