Excel から HTML - レイアウトを改善するには、PresentationPreference オプションを使用してください
Contents
[
Hide
]
Aspose.Cells は、Microsoft Excel ファイルを HTML または MHT 形式で保存するときに、より適切なレイアウトをレンダリングする必要がある開発者向けに、便利な HtmlSaveOptions.PresentationPreference プロパティを提供します。プロパティのデフォルト値は false です。 Excel レポートをより魅力的に表示するには、このプロパティを true に設定することをお勧めします。
以下のサンプル コードを参照して、プレゼンテーション設定をオンにして Excel レポートから 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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiate the Workbook | |
// Load an Excel file | |
Workbook workbook = new Workbook(dataDir+ "sample.xlsx"); | |
// Create HtmlSaveOptions object | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// Set the Presenation preference option | |
options.PresentationPreference = true; | |
// Save the Excel file to HTML with specified option | |
workbook.Save(dataDir+ "outPresentationlayout1.out.html", options); |