تصدير قيمة سلسلة HTML للخلايا إلى الجدول البياني
سيناريوهات الاستخدام المحتملة
باستخدام واجهات تطبيق برمجة Aspose.Cells، يمكن للمطورين ملء جدول بيانات مع سلاسل HTML المقابلة (بناءً على قيم الخلايا) أثناء تصدير بيانات ورقة العمل. يشرح هذا المستند كيفية تصدير سلاسل HTML لبيانات الخلايا المنسقة لملء جدول بيانات باستخدام واجهات تطبيق برمجة Aspose.Cells.
تصدير قيمة سلسلة HTML للخلايا إلى جدول البيانات
الشيفرة المصدرية للعينة التالية توضح كيفية تصدير قيمة سلسلة HTML للخلايا إلى الجدول البياني أثناء تصدير البيانات من ورقة العمل إلى جدول بيانات. يرجى الاطلاع على ملف الإكسل العيني، لقطة الشاشة الخاصة به وإخراج الوحدة النمطية لمرجع.
لقطة شاشة
الكود المثالي
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load sample Excel file | |
Workbook wb = new Workbook(sourceDir + "sampleExportTableAsHtmlString.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
//Specify export table options and set ExportAsHtmlString to true | |
ExportTableOptions opts = new ExportTableOptions(); | |
opts.ExportColumnName = false; | |
opts.ExportAsHtmlString = true; | |
//Export the cells data to data table with the specified export table options | |
DataTable dt = ws.Cells.ExportDataTable(0, 0, 3, 3, opts); | |
//Print the cell html string value that is in third row and second column | |
Console.WriteLine(dt.Rows[2][1].ToString()); |
مخرجات الوحدة
<Font Style="FONT-FAMILY: Calibri;FONT-SIZE: 11pt;COLOR: #00b0f0;Background-Color: #ffe699;">Crow</Font>