تصدير Excel إلى HTML مع خطوط الشبكة
Contents
[
Hide
]
إذا كنت ترغب في تصدير ملف إكسل الخاص بك إلى HTML مع خطوط شبكية، فمن فضلك استخدم خاصية HtmlSaveOptions.ExportGridLines واضبطها على true.
تصدير Excel إلى HTML مع خطوط الشبكة
الكود عينة التالي ينشئ دفتر عمل ويملأ ورقة البيانات به بعض القيم ويقوم بحفظه في تنسيق HTML بعد ضبط HtmlSaveOptions.ExportGridLines إلى true.
تقوم اللقطة الشاشة التالية بعرض مخرجات HTML التي تم إنشاؤها باستخدام هذا الكود العينة. كما يمكن رؤية خطوط الشبكة في ملف 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-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(ExportExceltoHTML.class); | |
// Create your workbook | |
Workbook wb = new Workbook(); | |
// Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
// Fill worksheet with some integer values | |
for (int r = 0; r < 10; r++) { | |
for (int c = 0; c < 10; c++) { | |
ws.getCells().get(r, c).putValue(r * 1); | |
} | |
} | |
// Save your workbook in HTML format and export gridlines | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.setExportGridLines(true); | |
wb.save(dataDir + "output.html", opts); |