كيفية التحكم في شريط علامة الورقة
Contents
[
Hide
]
سيناريوهات الاستخدام المحتملة
عندما تحتاج إلى ضبط عرض شريط الصفحة في Excel، تحتاج إلى معرفة كيفية التحكم في شريط تبويب الورقة، مثل إخفاء أو إظهار شريط تبويب الورقة، تغيير عرض شريط تبويب الورقة، تحديد علامة تبويب مرئية أولى، وما إلى ذلك. تدعم Aspose.Cells هذه الميزات. توفر Aspose.Cells الخصائص والأساليب التالية لمساعدتك في تحقيق أهدافك.
كيفية التحكم في شريط تبويب الورقة باستخدام Aspose.Cells for .NET
يوضح هذا المثال كيف:
- إنشاء دفتر عمل.
- إضافة بيانات إلى الخلايا في ورقة العمل الأولى.
- عرض علامة الورقة وتعيين عرض شريط التبويب.
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
//Instantiating an Workbook object | |
Workbook workbook = new Workbook(); | |
//Obtaining the reference of the newly added worksheet | |
Worksheet ws = workbook.Worksheets[0]; | |
Aspose.Cells.Cells cells = ws.Cells; | |
//Setting the value to the cells | |
Aspose.Cells.Cell cell = cells["A1"]; | |
cell.PutValue("Fruit"); | |
cell = cells["B1"]; | |
cell.PutValue("Count"); | |
cell = cells["C1"]; | |
cell.PutValue("Price"); | |
cell = cells["A2"]; | |
cell.PutValue("Apple"); | |
cell = cells["A3"]; | |
cell.PutValue("Mango"); | |
cell = cells["A4"]; | |
cell.PutValue("Blackberry"); | |
cell = cells["A5"]; | |
cell.PutValue("Cherry"); | |
//Display the sheet tab and set the width of the tab bar | |
workbook.Settings.ShowTabs = true; | |
workbook.Settings.SheetTabBarWidth = 150; | |
workbook.Save("out.xlsx"); |
معاينة ملف النتائج: