Bağlı Şekillerin Değerlerini Yenile
Örnek
Aşağıdaki ekran görüntüsü, örnek kodun kullanıldığı kaynak Excel dosyasını göstermektedir. A1 hücresine bağlı Resim 1 adlı bir şekle sahiptir. A1 hücresinin değerini Aspose.Cells ile değiştirecek ve sonra Worksheet.getShapes().updateSelectedValue() yöntemini kullanarak Resim 1‘in değerini yenileyecek ve PDF biçiminde kaydedeceğiz.
Verilen bağlantılardan kaynak Excel dosyasını ve çıktı PDF’sini indirebilirsiniz.
Bağlantılı şekillerin değerlerini yenilemek için Java kodu
// 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(RefreshValuesOfLinkedShapes.class); | |
// Create workbook from source file | |
Workbook workbook = new Workbook(dataDir + "LinkedShape.xlsx"); | |
// Access first worksheet | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Change the value of cell A1 | |
Cell cell = worksheet.getCells().get("A1"); | |
cell.putValue(100); | |
// Update the value of the Linked Picture which is linked to cell A1 | |
worksheet.getShapes().updateSelectedValue(); | |
// Save the workbook in pdf format | |
workbook.save(dataDir + "output.pdf", SaveFormat.PDF); |