Webブラウザがサポートしていない境界スタイルと類似した境界スタイルをC++でエクスポートする

可能な使用シナリオ

Microsoft Excelは、Webブラウザがサポートしない点線の境界線タイプをいくつかサポートしています。Aspose.Cellsを使用してこのようなExcelファイルをHTMLに変換すると、そのような境界線は削除されます。ただし、Aspose.CellsはHtmlSaveOptions.GetExportSimilarBorderStyle()プロパティを使用してその境界線を表示させることも可能です。その値をtrueに設定すると、サポートされていない境界線もHTMLファイルにエクスポートされます。

Webブラウザでサポートされていない場合の類似の境界線スタイルをHTMLにエクスポートする

以下のサンプルコードは、サポートされていない境界線を含むsample Excelファイルを読み込み、次のスクリーンショットに示すようにエクスポートします。スクリーンショットはまた、出力HTML内のHtmlSaveOptions.GetExportSimilarBorderStyle()プロパティの効果を示しています。

todo:image_alt_text

サンプルコード

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

    // Load the sample Excel file
    U16String inputFilePath(u"sampleExportSimilarBorderStyle.xlsx");
    Workbook workbook(inputFilePath);

    // Specify Html Save Options - Export Similar Border Style
    HtmlSaveOptions opts;
    opts.SetExportSimilarBorderStyle(true);

    // Save the workbook in Html format with specified Html Save Options
    U16String outputFilePath(u"outputExportSimilarBorderStyle.html");
    workbook.Save(outputFilePath, opts);

    std::cout << "Workbook saved successfully in HTML format with similar border styles!" << std::endl;

    Aspose::Cells::Cleanup();
}