Excel を HTML に変換する際にオーバーレイ コンテンツを非表示にする
Contents
[
Hide
]
Excel を HTML に変換する際にオーバーレイ コンテンツを非表示にする
Excel ファイルを HTML に保存すると、セル文字列に異なるクロス タイプを指定できます。デフォルトでは、Aspose.Cells は Microsoft Excel に従って HTML を生成しますが、HtmlSaveOptions.HtmlCrossStringTypeにクロス_隠れる_正しい次に、セル文字列とオーバーレイまたはオーバーラップしているセルの右側にあるすべての文字列を非表示にします。
次のサンプル コードは、サンプル Excel ファイルそしてそれをに保存します出力 HTMLを設定した後HtmlSaveOptions.HtmlCrossStringTypeなのでクロス_隠れる_正しい.スクリーンショットはその方法を説明していますクロス_隠れる_正しいデフォルト出力からの出力 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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
# Load the Sample Workbook | |
workbook = Workbook(source_directory + "sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.setHtmlCrossStringType(HtmlCrossType.CROSS_HIDE_RIGHT) | |
# Save the excel file. | |
workbook.save(output_directory + "outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", saveOptions) |