Exportar datos de filas visibles desde la hoja de trabajo
Contents
[
Hide
]
Puede exportar datos de hojas de trabajo a tablas de datos usando Aspose.Cells. A veces desea exportar los datos de las filas visibles únicamente. Aspose.Cells proporciona una manera de lograr esto. Utilizar elExportTableOptions.PlotVisibleRows para especificar que desea exportar solo datos de filas visibles.
Este ejemplo muestra cómo exportar datos de la siguiente hoja de cálculo. Las filas 5, 6 y 7 están ocultas.
Los datos de muestra en la hoja de trabajo, las filas 5, 6 y 7 están ocultas |
---|
![]() |
Una vez que los datos se exportan a una tabla de datos usando elHoja de trabajo.Cells.ExportDataTable() método con elExportTableOptions.PlotVisibleRowsopción, se verá así. Las filas ocultas se trazan como filas en blanco
Las filas ocultas se exportan a la tabla de datos como filas en blanco |
---|
![]() |
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); |