Trova il numero massimo di righe e colonne supportate dai formati XLS e XLSX
Contents
[
Hide
]
Possibili scenari di utilizzo
Esistono diversi numeri di righe e colonne supportati dai formati Excel. Ad esempio, XLS supporta 65536 righe e 256 colonne mentre XLSX supporta 1048576 righe e 16384 colonne. Se vuoi sapere quante righe e colonne sono supportate da un determinato formato, puoi utilizzareCartella di lavoro.Settings.MaxRow eCartella di lavoro.Settings.MaxColumnproprietà.
Trova il numero massimo di righe e colonne supportate dai formati XLS e XLSX
Il codice di esempio seguente crea la cartella di lavoro prima nel formato XLS e quindi nel formato XLSX. Dopo la creazione, stampa i valori diCartella di lavoro.Settings.MaxRow eCartella di lavoro.Settings.MaxColumnproprietà. Si prega di consultare l’output della console del codice fornito di seguito per riferimento.
Codice d’esempio
This file contains 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 | |
// 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); |
Uscita 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