ワークシートへのアクセス
Contents
[
Hide
]
このトピックでは、Aspose.Cells.GridWeb コントロールでのワークシートへのアクセスについて説明します。これらは Aspose.Cells.GridWeb に属し、Web アプリケーションで使用されるため、「Web ワークシート」と呼びます。
ワークシートへのアクセス
Aspose.Cells.GridWeb に含まれるすべてのワークシートは、GridWeb コントロールの GridWorksheetCollection に格納されます。ワークシートにアクセスするには、シート インデックスまたはシート名の 2 つの方法があります。
シート インデックスの使用
以下のコード スニペットは、シート インデックスを使用して 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/>"; |
シート名の使用
以下のコード スニペットは、シート名を使用して 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/>"; |