Excel, OpenOffice, Json, Csv ve Html dosyalarını yükleme ve yönetme
Contents
[
Hide
]
Aspose.Cells ile Excel dosyalarını oluşturmak, örneğin veri almak veya geliştirme sürecini hızlandırmak için bir tasarımcı şablonu kullanmak kolaydır.
Yeni Bir Çalışma Kitabı Oluşturma
Aşağıdaki örnek, sıfırdan yeni bir çalışma kitabı oluşturur.
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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
try | |
{ | |
// Create a License object | |
License license = new License(); | |
// Set the license of Aspose.Cells to avoid the evaluation limitations | |
license.SetLicense(dataDir + "Aspose.Cells.lic"); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} | |
// Instantiate a Workbook object that represents Excel file. | |
Workbook wb = new Workbook(); | |
// When you create a new workbook, a default "Sheet1" is added to the workbook. | |
Worksheet sheet = wb.Worksheets[0]; | |
// Access the "A1" cell in the sheet. | |
Cell cell = sheet.Cells["A1"]; | |
// Input the "Hello World!" text into the "A1" cell | |
cell.PutValue("Hello World!"); | |
// Save the Excel file. | |
wb.Save(dataDir + "MyBook_out.xlsx"); |
Bir Dosyayı Açma ve Kaydetme
Aspose.Cells ile Excel dosyalarını açmak, kaydetmek ve yönetmek kolaydır.
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 | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Opening through Path | |
// Creating a Workbook object and opening an Excel file using its file path | |
Workbook workbook1 = new Workbook(dataDir + "Book1.xlsx"); | |
//Adding new sheet | |
Worksheet sheet = workbook1.Worksheets.Add("MySheet"); | |
//Setting active aheet | |
workbook1.Worksheets.ActiveSheetIndex = 1; | |
//Setting values. | |
Cells cells = sheet.Cells; | |
//Setting text | |
cells["A1"].PutValue("Hello!"); | |
//Setting number | |
cells["A2"].PutValue(1000); | |
//Setting Date Time | |
Cell cell = cells["A3"]; | |
cell.Value = DateTime.Now; | |
Style style = cell.GetStyle(); | |
style.Number = 14; | |
cell.SetStyle(style); | |
//Setting formula | |
cells["A4"].Formula = "=SUM(A1:A3)"; | |
//Saving the workbook to disk. | |
workbook1.Save(dir + "dest.xlsx"); |
Gelişmiş Konular
- Dosyaları Açmanın Farklı Yolları
- Çalışma Kitabını yüklerken Tanımlanmış Adları Filtrele
- Çalışma Kitabını veya Çalışma Sayfasını Yüklerken Nesneleri Filtrele
- Şablon dosyasından çalışma kitabını yüklerken veri türünü filtreleme
- Excel Dosyası Yüklenirken Uyarıları Al
- Grafikleri Olmadan Kaynak Excel Dosyasını Yükleme
- Bir Çalışma Kitabındaki Belirli Çalışma Sayfalarını Yükleme
- Belirtilen Yazıcı Kağıdı Boyutuyla Çalışma Kitabı Yükle
- Farklı Microsoft Excel Sürümlerini Açma
- Farklı Biçimlerde Dosyaları Açma
- Büyük Veri Kümesine Sahip Büyük Dosyalarla Çalışırken Hafıza Kullanımını Optimize Etme
- Numbers Elektronik Tablosu, Apple Inc. tarafından geliştirildi.
- Çok uzun sürüyorsa, Duraklatma İzleyiciyi kullanarak dönüşümü veya yüklemeyi durdurun
- LightCells API’sını Kullanma
- CSV’yi JSON’a dönüştür
- Excel’i JSON’a dönüştür
- JSON’ı CSV’ye dönüştür
- JSON’ı Excel’e dönüştür
- Excel’i HTML’ye dönüştür