ワークシートをコピーする
Contents
[
Hide
]
ワークシートを追加Aspose.Cells.GridWeb に新しいワークシートを追加する方法について説明します。別のワークシートのコピー (またはレプリカ) を Aspose.Cells.GridWeb コントロールに追加することもできます。この機能は、あるワークシートの同一または類似のデータが別のワークシートでも必要な場合に役立ちます。その場合、ゼロから作成するよりも、既存のワークシートをコピーして Aspose.Cells.GridWeb に新しいワークシートとして追加する方が簡単です。
ワークシートのコピー
シート インデックスの使用
以下のコード例は、GridWorksheetCollection の AddCopy メソッドでワークシートのインデックスを指定することにより、ワークシートのコピーを GridWeb コントロールに追加する方法を示しています。
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 | |
// Adding the copy of a worksheet to GridWeb by specifying its sheet index | |
int sheetIndex = GridWeb1.WorkSheets.AddCopy(0); |
シート名の使用
次のコード例は、GridWorksheetCollection の AddCopy メソッドでワークシートの名前を指定して、ワークシートのコピーを GridWeb コントロールに追加する方法を示しています。
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 | |
// Adding the copy of a worksheet to GridWeb by specifying its sheet name | |
int sheetIndex1 = GridWeb1.WorkSheets.AddCopy("Students"); |
AddCopy メソッドは、ワークシート インスタンスへのアクセスに使用できる、新しく追加されたワークシートのインデックスを返します。ワークシートへのアクセス方法の詳細については、次を参照してください。ワークシートへのアクセス.