Tabelle e intervalli

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:

  1. Fare clic in un punto qualsiasi della tabella per assicurarsi che la cella attiva sia in una colonna della tabella.
  2. SulDesign scheda, nelUtensili gruppo, fare clicConverti in intervallo.

Utilizzando Aspose.Cells

Il seguente frammento di codice illustra la stessa funzionalità utilizzando Aspose.Cells.

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")));