HTML への保存時に非表示のワークシートの内容をエクスポートできないようにする
Excel ワークブックを HTML に保存できます。ただし、ワークブックに非表示のワークシートが含まれている場合、既定では、Aspose.Cells は非表示のワークシートの内容を HTML 出力にエクスポートします (_ files) ディレクトリには、ワークシート、画像、tabstrip.htm、stylesheet.css などのファイルが含まれています。非表示のワークシートの内容をこの方法でエクスポートすることが適切でない場合があります。たとえば、非表示のワークシートにエクスポートしてはならない画像が含まれている場合、_ファイル ディレクトリ。
Aspose.Cells はHtmlSaveOptions.ExportHiddenWorksheet 財産。デフォルトでは、真実 非表示のワークシートは HTML にエクスポートされます。間違い 、Aspose.Cells は、非表示のワークシートの内容をエクスポートしません。
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
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Create workbook object
Workbook workbook = new Workbook(dataDir + "WorkbookWithHiddenContent.xlsx");
// Do not export hidden worksheet contents
HtmlSaveOptions options = new HtmlSaveOptions();
options.ExportHiddenWorksheet = false;
// Save the workbook
workbook.Save(dataDir + "HtmlWithoutHiddenContent_out.html", options);