第10章-行列操作与分组

第十章:行列操作与分组

10.1 行列分组

public class RowColumnGrouping
{
    private Worksheet sheet;
    
    // 创建行分组
    public void CreateRowGroup(int startRow, int endRow)
    {
        sheet.GroupRows(startRow, endRow);
    }
    
    // 创建列分组
    public void CreateColumnGroup(int startCol, int endCol)
    {
        sheet.GroupColumns(startCol, endCol);
    }
    
    // 展开/折叠分组
    public void ToggleGroup(int row, int col, bool expand)
    {
        if (expand)
            sheet.ExpandGroup(row, col);
        else
            sheet.CollapseGroup(row, col);
    }
}

10.2 大纲视图

public class OutlineView
{
    public void SetOutlineLevel(Worksheet sheet, int row, int level)
    {
        sheet.SetRowOutlineLevel(row, level);
    }
}

10.3 本章小结

本章介绍了行列分组和大纲功能。

📚 下一章预告

第十一章将学习图表与可视化。

posted @ 2025-12-31 14:07  我才是银古  阅读(7)  评论(0)    收藏  举报