اظهر الصيغ بدلاً من القيم في ورقة عمل

Contents
[ ]

يوفر Aspose.Cells خاصية Worksheet.setShowFormulas(). قم بتعيين هذا إلى true لإعداد Microsoft Excel لعرض الصيغ.

الصورة التالية تظهر ورقة العمل التي تحتوي على صيغة في الخلية A3: =Sum(A1:A2).

ورقة عمل بصيغة في الخلية A3

todo:image_alt_text

تُظهر الصورة التالية الصيغة بدلاً من القيمة المحسوبة، بعد تمكين خاصية Worksheet.setShowFormulas() بالقيمة true باستخدام Aspose.Cells.

تعرض الورقة الآن الصيغة بدلاً من القيمة المحسوبة

todo:image_alt_text

// 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(ShowFormulas.class);
// Load the source workbook
Workbook workbook = new Workbook(dataDir + "source.xlsx");
// Access the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
// Show formulas of the worksheet
worksheet.setShowFormulas(true);
// Save the workbook
workbook.save(dataDir + "out.xlsx");