HTMLで保存する際のCrossHideRightでオーバーレイされたコンテンツを非表示にする
Contents
[
Hide
]
可能な使用シナリオ
ExcelファイルをHTMLに保存する際に、セル文字列の異なるクロスタイプを指定できます。デフォルトでは、Aspose.CellsはMicrosoft Excelに従ったHTMLを生成しますが、クロスタイプをCrossHideRightに変更すると、セル文字列と重なり合う右側のすべての文字列が非表示になります。
CrossHideRightを使用してオーバーレイコンテンツを非表示にする
次のサンプルコードは、HtmlSaveOptions.HtmlCrossStringTypeをCrossHideRightに設定してから、サンプルExcelファイルを読み込み、output HTMLに保存します。スクリーンショットはdefault outputから**CrossHideRight**が出力されたHTMLへの影響を示しています。
サンプルコード
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 | |
//Load sample Excel file | |
Workbook wb = new Workbook(sourceDir + "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx"); | |
//Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.HtmlCrossStringType = HtmlCrossType.CrossHideRight; | |
//Save to HTML with HtmlSaveOptions | |
wb.Save(outputDir + "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", opts); |