تصدير Excel إلى HTML مع خطوط الشبكة

تصدير Excel إلى HTML مع خطوط الشبكة

يقوم الكود المعروض بإنشاء دفتر عمل وملئ ورقته ببعض القيم ثم يحفظه بتنسيق HTML بعد ضبط HtmlSaveOptions.ExportGridLines إلى صحيحة.

// 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 your workbook
Workbook wb = new Workbook();
// Access first worksheet
Worksheet ws = wb.Worksheets[0];
// Fill worksheet with some integer values
for (int r = 0; r < 10; r++)
{
for (int c = 0; c < 10; c++)
{
ws.Cells[r, c].PutValue(r * 1);
}
}
// Save your workbook in HTML format and export gridlines
HtmlSaveOptions opts = new HtmlSaveOptions();
opts.ExportGridLines = true;
wb.Save(dataDir + "ExportToHTMLWithGridLines_out.html", opts);