Excel Tablosunu Veri Aralığına Dönüştürme

Microsoft Excel’i kullanma

KullanAralığa Dönüştür biçimlendirmeyi kaybetmeden bir tabloyu hızla bir aralığa dönüştürme özelliği. Microsoft Excel 2007/2010’da:

  1. Aktif hücrenin bir tablo sütununda olduğundan emin olmak için tabloda herhangi bir yeri tıklayın.

yapılacaklar:resim_alternatif_metin

  1. ÜzerindeTasarım sekmesinde, içindeAraçlar grup, tıklayınAralığa Dönüştür.

yapılacaklar:resim_alternatif_metin

Aspose.Cells’i kullanma

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ConvertTableToRange.class) + "tables/";
// Open an existing file that contains a table/list object in it
Workbook wb = new Workbook(dataDir + "book1.xlsx");
// Convert the first table/list object (from the first worksheet) to normal range
wb.getWorksheets().get(0).getListObjects().get(0).convertToRange();
// Save the file
wb.save(dataDir + "ConvertTableToRange_out.xlsx");

Seçeneklerle Tabloyu Aralığa Dönüştür

Aspose.Cells, Tabloyu Aralığa dönüştürürken ek seçenekler sunar.TableToRangeOptionssınıf. buTableToRangeOptionssınıf sağlarSon Sıratablo satırının son dizinini ayarlamanıza izin veren özellik. Tablo biçimlendirmesi, belirtilen satır dizinine kadar korunacak ve biçimlendirmenin geri kalanı kaldırılacaktır.

Aşağıda verilen örnek kod,TableToRangeOptionssınıf.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(ConvertTableToRangeWithOptions.class) + "Tables/";
// Open an existing file that contains a table/list object in it
Workbook workbook = new Workbook(dataDir + "book1.xlsx");
TableToRangeOptions options = new TableToRangeOptions();
options.setLastRow(5);
// Convert the first table/list object (from the first worksheet) to normal range
workbook.getWorksheets().get(0).getListObjects().get(0).convertToRange(options);
// Save the file
workbook.save(dataDir + "ConvertTableToRangeWithOptions_out.xlsx");