إظهار الصيغ بدلاً من القيم في ورقة عمل
Contents
[
Hide
]
من الممكن إظهار الصيغ بدلاً من القيم المحسوبة في Microsoft Excel باستخدام tإظهار الصيغ خيار منالصيغشريط. عند عرض الصيغ ، يقوم Microsoft Excel بعرض الصيغ في ورقة العمل. يمكنك تحقيق نفس الشيء باستخدام Aspose.Cells.
يوفر Aspose.Cells أWorksheet.setShowFormulas () خاصية. اضبط هذا علىحقيقيلتعيين Microsoft Excel لعرض الصيغ.
تُظهر الصورة التالية ورقة العمل التي تحتوي على صيغة في الخلية A3: = Sum (A1: A2).
ورقة عمل بالصيغة الموجودة في الخلية A3
تُظهر الصورة التالية الصيغة بدلاً من القيمة المحسوبة ، والتي يتم تمكينها من خلال تعيينWorksheet.setShowFormulas () ملكية لحقيقي مع Aspose.Cells.
تعرض ورقة العمل الآن الصيغة بدلاً من القيمة المحسوبة
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-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"); |