Node.js経由でC++を使用したHTML保存時のオーバーレイコンテンツをCrossHideRightで隠す
Contents
[
Hide
]
可能な使用シナリオ
ExcelファイルをHTMLに保存する際、セル文字列に対して異なるクロスタイプを指定できます。デフォルトでは、Aspose.CellsはMicrosoft Excelに従ってHTMLを生成しますが、CrossHideRightにクロスタイプを設定すると、セルの右側に重ね合わされたり重複したセル文字列がある場合、その文字列を非表示にします。
CrossHideRightを使用してオーバーレイコンテンツを非表示にする
次のサンプルコードは、サンプルExcelファイルを読み込み、HtmlSaveOptions.getHtmlCrossStringType()をCrossHideRightに設定した後、出力HTMLに保存します。スクリーンショットは、CrossHideRightがどのように出力に影響するかを示しています。
サンプルコード
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Load sample Excel file
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx");
const workbook = new AsposeCells.Workbook(filePath);
// Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html
const opts = new AsposeCells.HtmlSaveOptions();
opts.setHtmlCrossStringType(AsposeCells.HtmlCrossType.CrossHideRight);
// Save to HTML with HtmlSaveOptions
workbook.save(path.join(dataDir, "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html"), opts);