[]
Iterable<ICustomView>此接口表示 Workbook.getCustomViews() 返回的集合。集合中的每一项都是 ICustomView,用于存储工作簿自定义视图,并且可以按名称检索、添加到工作簿或按顺序迭代。
worksheet.getPageSetup().setPrintArea("$A$1:$C$10");
ICustomViews customViews = workbook.getCustomViews();
customViews.add("PrintView", true, false);
ICustomView customView = customViews.get("PrintView");
customView.show();
ICustomView 对象。intgetCount()forEach, iterator, spliterator此方法返回当前可用的 ICustomView 对象数量,这些对象来自 Workbook.getCustomViews()。
worksheet.getPageSetup().setPrintArea("$A$1:$C$10");
workbook.getCustomViews().add("PrintView", true, false);
workbook.getCustomViews().add("HiddenRows", false, true);
int count = workbook.getCustomViews().getCount();
ICustomView 对象。使用此方法可以检索先前添加到此集合的自定义工作簿视图,然后通过调用 ICustomView.show() 应用它。
workbook.getCustomViews().add("PrintSetting", true, false);
ICustomView customView = workbook.getCustomViews().get("PrintSetting");
customView.show();
viewName - 集合中自定义视图的名称。ICustomView 对象。自定义视图捕获工作簿中所有工作表的当前视图状态。如果已存在同名自定义视图,则现有自定义视图将被替换。当工作簿包含表格或数据透视表时,无法添加自定义视图。
worksheet.getPageSetup().setPrintArea("$A$1:$C$10");
ICustomView customView = workbook.getCustomViews().add("PrintView", true, false);
customView.show();
viewName - 自定义视图的名称。不得为 null、空或空白。printSettings - true 表示在自定义视图中包含打印设置;否则为 false。rowColSettings - true 表示在自定义视图中包含隐藏的行和列设置(包括筛选信息);否则为 false。ICustomView。IllegalArgumentException - 如果 viewName 为 null、空或空白,或者工作簿包含表格或数据透视表。