ワークシートからの可視行データのエクスポート
Contents
[
Hide
]
Aspose.Cells を使用して、ワークシートからデータ テーブルにデータをエクスポートできます。表示されている行のデータのみをエクスポートしたい場合があります。 Aspose.Cells は、これを実現する方法を提供します。使用ExportTableOptions.PlotVisibleRows表示されている行データのみをエクスポートすることを指定します。
この例は、次のワークシートからデータをエクスポートする方法を示しています。行 5、6、および 7 は非表示になっています。
ワークシートのサンプル データ、行 5、6、および 7 は非表示 |
---|
![]() |
を使用してデータがデータ テーブルにエクスポートされると、Worksheet.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); |