Esporta i dati delle righe visibili dal foglio di calcolo

Contents
[ ]

Questo esempio mostra come esportare i dati dal foglio di calcolo seguente. Le righe 5, 6 e 7 sono nascoste.

Dati di esempio nel foglio di lavoro, le righe 5, 6 e 7 sono nascoste
todo:image_alt_text

Una volta che i dati sono esportati in una tabella utilizzando il metodo Worksheet.Cells.ExportDataTable() con l’opzione ExportTableOptions.PlotVisibleRows, apparirà così. Le righe nascoste sono visualizzate come righe vuote

Le righe nascoste vengono esportate nella tabella dei dati come righe vuote
todo:image_alt_text
// 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);