قم بتحديث قيم الأشكال المرتبطة

مثال

تُظهر لقطة الشاشة التالية ملف Excel المصدر المستخدم في نموذج التعليمات البرمجية أدناه. لها ارتباطالصورة 1 مرتبط بالخلية A1. سنقوم بتغيير قيمة الخلية A1 مع Aspose.Cells ثم الاتصالWorksheet.getShapes (). updateSelectedValue () طريقة لتحديث قيمةالصورة 1 وحفظه بتنسيق PDF.

ما يجب القيام به: image_بديل_نص

يمكنك تنزيل ملفملف Excel المصدر و الالإخراج PDF من الروابط المعطاة.

كود Java لتجديد قيم الأشكال المرتبطة

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