تنفيذ الأخطاء والقيمة المنطقية باللغة الروسية أو أي لغة أخرى
Contents
[
Hide
]
سيناريوهات الاستخدام الممكنة
إذا كنت تستخدم Microsoft Excel باللغة الروسية أو اللغة أو أي لغة أو لغة أخرى ، فسوف يعرض الأخطاء والقيم المنطقية وفقًا لتلك اللغة أو اللغة. يمكنك تحقيق سلوك مشابه باستخدام Aspose.CellsWorkbook.getSettings (). setGlobalizationSettings () طريقة أو خاصية. سيكون عليك تجاوز الطرق التالية لـالعولمة الإعداداتصف دراسي.
تنفيذ الأخطاء والقيمة المنطقية باللغة الروسية أو أي لغة أخرى
يوضح نموذج التعليمات البرمجية التالي كيفية تنفيذ الأخطاء والقيمة المنطقية باللغة الروسية أو أي لغة أخرى. يرجى التحقق من نموذج ملف Excel المستخدم في هذا الرمز ومخرجاته PDF. توضح لقطة الشاشة الفرق بيننموذج لملف Excel و الالخرج PDF كمرجع.
عينة من الرموز
This file contains hidden or 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 | |
public class ImplementErrorsAndBooleanValueInRussianOrAnyOtherLanguage { | |
// Russian Globalization | |
class RussianGlobalization extends GlobalizationSettings { | |
public String getErrorValueString(String err) { | |
switch (err.toUpperCase()) { | |
case "#NAME?": | |
return "#RussianName-имя?"; | |
} | |
return "RussianError-ошибка"; | |
} | |
public String getBooleanValueString(Boolean bv) { | |
return bv ? "RussianTrue-правда" : "RussianFalse-ложный"; | |
} | |
} | |
public void Run() throws Exception { | |
System.out.println("Aspose.Cells for Java Version: " + CellsHelper.getVersion()); | |
String srcDir = Utils.Get_SourceDirectory(); | |
String outDir = Utils.Get_OutputDirectory(); | |
// Load the source workbook | |
Workbook wb = new Workbook(srcDir + "sampleRussianGlobalization.xlsx"); | |
// Set GlobalizationSettings in Russian Language | |
wb.getSettings().setGlobalizationSettings(new RussianGlobalization()); | |
// Calculate the formula | |
wb.calculateFormula(); | |
// Save the workbook in pdf format | |
wb.save(outDir + "outputRussianGlobalization.pdf"); | |
} | |
public static void main(String[] args) throws Exception { | |
ImplementErrorsAndBooleanValueInRussianOrAnyOtherLanguage impErr = new ImplementErrorsAndBooleanValueInRussianOrAnyOtherLanguage(); | |
impErr.Run(); | |
} | |
} |