Smart Markers でデータをマージする際の通知の取得
Contents
[
Hide
]
Aspose.Cells のAPIでは、WorkbookDesigner クラスが提供されており、Smart Markers を扱うための designer spreadsheets に書式や数式を配置し、その後 WorkbookDesigner クラスを使用して指定された Smart Markers に従ってデータを埋めることができます。時には、セル参照や特定の Smart Marker の処理について通知を受け取る必要があります。これは、WorkbookDesigner.CallBack プロパティと、リリースAspose.Cells for .NET 8.6.2で公開された ISmartMarkerCallBack インターフェースを使用して実現できます。
ISmartMarkerCallBack インターフェースの使用例
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 | |
class SmartMarkerCallBack: ISmartMarkerCallBack | |
{ | |
Workbook workbook; | |
public SmartMarkerCallBack(Workbook workbook) { | |
this.workbook = workbook; | |
} | |
public void Process(int sheetIndex, int rowIndex, int colIndex, String tableName, String columnName) { | |
Console.WriteLine("Processing Cell: " + workbook.Worksheets[sheetIndex].Name + "!" + CellsHelper.CellIndexToName(rowIndex, colIndex)); | |
Console.WriteLine("Processing Marker: " + tableName + "." + columnName); | |
} | |
} |
残りの処理は、WorkbookDesigner で Smart Markers を含むテンプレートを読み込み、データソースを設定して処理することです。この例では、簡単のために、データソースを動的に作成し、下のスナップショットに表示されているように、2つのSmart Markers を含む事前定義のデザイナースプレッドシートを使用しています。
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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
|