Tabelle e intervalli
Contents
[
Hide
]
introduzione
volte crei una tabella in Microsoft Excel e non vuoi continuare a lavorare con la funzionalità della tabella che ne deriva. Invece, vuoi qualcosa che assomigli a un tavolo. Per mantenere i dati in una tabella senza perdere la formattazione, convertire la tabella in un normale intervallo di dati. Aspose.Cells supporta questa funzionalità di Microsoft Excel per tabelle e oggetti elenco.
Utilizzando Microsoft Excel
Usa ilConverti in intervallo funzionalità per convertire rapidamente una tabella in un intervallo senza perdere la formattazione. In Microsoft Excel 2007/2010:
- Fare clic in un punto qualsiasi della tabella per assicurarsi che la cella attiva sia in una colonna della tabella.
- SulDesign scheda, nelUtensili gruppo, fare clicConverti in intervallo.
Le funzionalità della tabella non sono più disponibili dopo che la tabella è stata convertita in un intervallo. Ad esempio, le intestazioni di riga non includono più le frecce di ordinamento e filtro e i riferimenti strutturati (riferimenti che utilizzano nomi di tabella) utilizzati nelle formule si trasformano in normali riferimenti di cella.
Utilizzando Aspose.Cells
Il seguente frammento di codice illustra la stessa funzionalità utilizzando Aspose.Cells.
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-C | |
// Instantiate a Workbook object and open an Excel file | |
intrusive_ptr<IWorkbook> workbook =Factory::CreateIWorkbook(dataDir_Tables->StringAppend(new String("sample.xlsx"))); | |
// Accessing the first worksheet in the Excel file | |
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0); | |
// Get the List objects collection in the first worksheet. | |
intrusive_ptr<IListObjectCollection> listObjects = worksheet->GetIListObjects(); | |
// Convert the first table/list object (from the first worksheet) to normal range | |
listObjects->GetObjectByIndex(0)->ConvertToRange(); | |
// Saving the Excel file | |
workbook->Save(dataDir_Tables->StringAppend(new String("ConvertTableToRange_out.xls"))); |