إظهار الفاصلة العليا في الخلايا
Contents
[
Hide
]
إظهار الفاصلة العليا في الخلايا
في Microsoft Excel ، يتم إخفاء الفاصلة العليا في قيمة الخلية. يوفر Aspose.Cells خاصية لعرض الفاصلة العليا بشكل افتراضي. لهذا ، يوفر APIالمصنف.الإعداداتخاصية. تشير هذه الخاصية إلى ما إذا كان سيتم تعيين ملفاقتباسالخاصية عند إدخال قيمة سلسلة تبدأ بعلامة اقتباس واحدة للخلية. وضعالمصنف.الإعداداتملكية لخاطئةسيعرض الفاصلة العليا في ملف Excel الناتج.
تُظهر لقطة الشاشة التالية ملف Excel الناتج مع الفاصلة العليا المرئية.
يوضح مقتطف الكود التالي هذا عن طريق إضافة البيانات باستخدام Smart Markers في ملف Excel المصدر. يتم إرفاق ملفات إكسل المصدر والمخرجات كمرجع.
عينة من الرموز
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 | |
//directories | |
String sourceDir = Utils.Get_SourceDirectory(); | |
String outputDir = Utils.Get_OutputDirectory(); | |
// Instantiating a WorkbookDesigner object | |
WorkbookDesigner designer = new WorkbookDesigner(); | |
Workbook workbook = new Workbook(sourceDir + "AllowLeadingApostropheSample.xlsx"); | |
workbook.getSettings().setQuotePrefixToStyle(false); | |
// Open a designer spreadsheet containing smart markers | |
designer.setWorkbook(workbook); | |
ArrayList<DataObject> list = new ArrayList<>(); | |
list.add(new DataObject(1, "demo")); | |
list.add(new DataObject(2, "'demo")); | |
// Set the data source for the designer spreadsheet | |
designer.setDataSource("sampleData", list); | |
// Process the smart markers | |
designer.process(); | |
designer.getWorkbook().save(outputDir + "AllowLeadingApostropheSample_out.xlsx"); |
تنفيذDataObjectيتم إعطاء فئة أدناه
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 | |
public class DataObject | |
{ | |
private int id; | |
private String name; | |
public DataObject(int id, String name) | |
{ | |
this.id = id; | |
this.name = name; | |
} | |
public int getId() | |
{ | |
return this.id; | |
} | |
public void setId(int value) | |
{ | |
this.id = value; | |
} | |
public String getName() | |
{ | |
return this.name; | |
} | |
public void setName(String value) | |
{ | |
this.name = value; | |
} | |
} |