Hiding Overlaid Content with CrossHideRight while saving to HTML with C++
Contents
[
Hide
]
Possible Usage Scenarios
When you save your Excel file to HTML, you can specify different cross types for cell strings. By default, Aspose.Cells generates HTML as per Microsoft Excel but when you change the cross type to CrossHideRight, then it hides all the strings on the right side of the cell that are overlaid or overlapping with the cell string.
Hiding Overlaid Content with CrossHideRight while saving to Html
The following sample code loads the sample Excel file and saves it to output HTML after setting the HtmlSaveOptions.GetHtmlCrossStringType() as CrossHideRight. The screenshot explains how CrossHideRight affects the output HTML from the default output.
Sample Code
#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 sample Excel file
U16String sourceDir(u"..\\Data\\01_SourceDirectory\\");
U16String outputDir(u"..\\Data\\02_OutputDirectory\\");
Workbook wb(sourceDir + u"sampleHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.xlsx");
// Specify HtmlSaveOptions - Hide Overlaid Content with CrossHideRight while saving to Html
HtmlSaveOptions opts;
opts.SetHtmlCrossStringType(HtmlCrossType::CrossHideRight);
// Save to HTML with HtmlSaveOptions
wb.Save(outputDir + u"outputHidingOverlaidContentWithCrossHideRightWhileSavingToHtml.html", opts);
std::cout << "File saved successfully!" << std::endl;
Aspose::Cells::Cleanup();
}