Çalışma Kitabının Otomatik Kurtarma Özelliğini Ayarlamak

Çalışma Kitabının Otomatik Kurtarma Özelliğini Ayarlamak için Java Kodu

Aşağıdaki kod, çalışma kitabının Workbook.getSettings().setAutoRecover() özelliğinin nasıl kullanılacağını açıklar. Kod önce bu özelliğin varsayılan değerini (true) okur, ardından onu false olarak ayarlar ve çalışma kitabını kaydeder. Sonra çalışma kitabını tekrar okur ve bu özelliğin o anda false olan değerini okur.

// 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.getDataDir(SetAutoRecoverProperty.class);
// Create workbook object
Workbook workbook = new Workbook();
// Read AutoRecover property
System.out.println("AutoRecover: " + workbook.getSettings().getAutoRecover());
// Set AutoRecover property to false
workbook.getSettings().setAutoRecover(false);
// Save the workbook
workbook.save("output.xlsx");
// Read the saved workbook again
workbook = new Workbook("output.xlsx");
// Read AutoRecover property
System.out.println("AutoRecover: " + workbook.getSettings().getAutoRecover());

Örnek Kod Tarafından Oluşturulan Çıkış

Yukarıdaki örnek kodun konsol çıktısı burada gösterilmektedir.

AutoRecover: true

AutoRecover: false