ワークシートへのアクセス
Contents
[
Hide
]
このトピックでは、Aspose.Cells.GridWeb コントロール内のワークシートへのアクセスについて説明します。Aspose.Cells.GridWeb に属するため、ウェブアプリケーションで使用される ‘web ワークシート’ として参照します。
ワークシートへのアクセス
Aspose.Cells.GridWeb に含まれるすべてのワークシートは、GridWeb コントロールの GridWorksheetCollection に格納されています。ワークシートにアクセスする方法は、シートインデックスまたはシート名によって行うことができます。
シートインデックスの使用
以下のコードスニペットは、sheetのインデックスを使用してGridWebコントロールのGridWorksheetCollectionから特定のWebワークシートにアクセスする方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Accessing a worksheet using its index | |
GridWorksheet sheet = GridWeb1.WorkSheets[0]; | |
Label1.Text = "Sheet at index 0 is : " + sheet.Name + "<br/>"; |
シート名を使用する
以下のコードスニペットは、sheet名を使用してGridWebコントロールのGridWorksheetCollectionコレクションからWebワークシートにアクセスする方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Accessing a worksheet using its name | |
GridWorksheet sheet1 = GridWeb1.WorkSheets["Catalog"]; | |
Label1.Text += "Index of sheet Catalog is : " + sheet1.Index + "<br/>"; |