在xlsx4j中显示和隐藏工作簿的滚动条
Contents
[
Hide
]
Aspose.Cells - 显示和隐藏工作簿的滚动条
Aspose.Cells提供了一个代表Excel文件的Workbook类。Workbook类提供了广泛的属性和方法来管理Excel文件。但是,为了控制Excel文件中滚动条的可见性,开发人员可以使用Workbook类的setVScrollBarVisible和setHScrollBarVisible方法。
Java
//Instantiating a Excel object by excel file path
Workbook workbook = new Workbook(dataDir + "book1.xls");
//Hiding the vertical scroll bar of the Excel file
workbook.getSettings().setVScrollBarVisible(false);
//Hiding the horizontal scroll bar of the Excel file
workbook.getSettings().setHScrollBarVisible(false);
//Saving the modified Excel file in default (that is Excel 2003) format
workbook.save(dataDir + "AsposeSrollbarsHide.xls");
// ===============================================================
//Displaying the vertical scroll bar of the Excel file
workbook.getSettings().setVScrollBarVisible(true);
//Displaying the horizontal scroll bar of the Excel file
workbook.getSettings().setHScrollBarVisible(true);
//Saving the modified Excel file in default (that is Excel 2003) format
workbook.save(dataDir + "AsposeDisplaySrollbars.xls");