قراءة وكتابة الجدول مع مصدر بيانات جدول الاستعلام
Contents
[
Hide
]
قراءة وكتابة الجدول مع مصدر بيانات جدول الاستعلام
مع Aspose.Cells، يمكنك قراءة وكتابة جدول يحتوي على جدول الاستعلام كمصدر بيانات. الدعم لهذه الميزة متاح أيضًا لملفات XLS. يوضح الكود التالي قراءة وكتابة مثل هذا الجدول من خلال قراءة الجدول أولاً ثم تعديله لإضافة صف الإجماليات.
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-.NET | |
// The path to the source directory. | |
string sourceDir = RunExamples.Get_SourceDirectory(); | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
// Load workbook object | |
Workbook workbook = new Workbook(sourceDir + "SampleTableWithQueryTable.xls"); | |
Worksheet worksheet = workbook.Worksheets[0]; | |
ListObject table = worksheet.ListObjects[0]; | |
// Check the data source type if it is query table | |
if (table.DataSourceType == TableDataSourceType.QueryTable) | |
{ | |
table.ShowTotals = true; | |
} | |
// Save the file | |
workbook.Save(outputDir + "SampleTableWithQueryTable_out.xls"); |
الملفات الإكسل المصدر والناتج مرفقة للرجوع إليها.