Trova il numero massimo di righe e colonne supportate dai formati XLS e XLSX
Possibili Scenari di Utilizzo
Esistono un numero diverso di righe e colonne supportate dai formati di Excel. Per esempio, XLS supporta 65536 righe e 256 colonne mentre XLSX supporta 1048576 righe e 16384 colonne. Se desideri sapere quante righe e colonne sono supportate dal formato dato, puoi utilizzare le proprietà Workbook.Settings.MaxRow e Workbook.Settings.MaxColumn.
Trova il numero massimo di righe e colonne supportate dai formati XLS e XLSX
Il codice di esempio seguente crea prima un foglio di lavoro in formato XLS e poi in formato XLSX. Dopo la creazione, stampa i valori delle proprietà Workbook.Settings.MaxRow e Workbook.Settings.MaxColumn. Consultare l’output della console del codice sottostante per il riferimento.
Codice di Esempio
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Print message about XLS format. | |
Console.WriteLine("Maximum Rows and Columns supported by XLS format."); | |
// Create workbook in XLS format. | |
Workbook wb = new Workbook(FileFormatType.Excel97To2003); | |
// Print the maximum rows and columns supported by XLS format. | |
int maxRows = wb.Settings.MaxRow + 1; | |
int maxCols = wb.Settings.MaxColumn + 1; | |
Console.WriteLine("Maximum Rows: " + maxRows); | |
Console.WriteLine("Maximum Columns: " + maxCols); | |
Console.WriteLine(); | |
// Print message about XLSX format. | |
Console.WriteLine("Maximum Rows and Columns supported by XLSX format."); | |
// Create workbook in XLSX format. | |
wb = new Workbook(FileFormatType.Xlsx); | |
// Print the maximum rows and columns supported by XLSX format. | |
maxRows = wb.Settings.MaxRow + 1; | |
maxCols = wb.Settings.MaxColumn + 1; | |
Console.WriteLine("Maximum Rows: " + maxRows); | |
Console.WriteLine("Maximum Columns: " + maxCols); |
Output della console
Maximum Rows and Columns supported by XLS format.
Maximum Rows: 65536
Maximum Columns: 256
Maximum Rows and Columns supported by XLSX format.
Maximum Rows: 1048576
Maximum Columns: 16384