تصدير بيانات الصفوف المرئية من ورقة العمل
Contents
[
Hide
]
يمكنك تصدير البيانات من أوراق العمل إلى جداول البيانات باستخدام Aspose.Cells. أحيانًا تريد تصدير بيانات الصفوف المرئية فقط. يوفر Aspose.Cells طريقة لتحقيق ذلك. استخدم الExportTableOptions.PlotVisibleRows لتحديد رغبتك في تصدير بيانات الصفوف المرئية فقط.
يوضح هذا المثال كيفية تصدير البيانات من ورقة العمل التالية. الصفوف 5 و 6 و 7 مخفية.
البيانات النموذجية في ورقة العمل ، الصفوف 5 و 6 و 7 مخفية |
---|
![]() |
بمجرد تصدير البيانات إلى جدول بيانات باستخدام امتدادورقة العمل Cells.ExportDataTable () الطريقة معExportTableOptions.PlotVisibleRowsالخيار ، سيبدو مثل هذا. يتم رسم الصفوف المخفية كصفوف فارغة
يتم تصدير الصفوف المخفية إلى جدول البيانات كصفوف فارغة |
---|
![]() |
This file contains hidden or 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 documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
string filePath = dataDir+ "aspose-sample.xlsx"; | |
// Load the source workbook | |
Workbook workbook = new Workbook(filePath); | |
// Access the first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Specify export table options | |
ExportTableOptions exportOptions = new ExportTableOptions(); | |
exportOptions.PlotVisibleRows = true; | |
exportOptions.ExportColumnName = true; | |
// Export the data from worksheet with export options | |
DataTable dataTable = worksheet.Cells.ExportDataTable(0, 0, 10, 4, exportOptions); |