انشاء كائن نمط باستخدام فئة CellsFactory
Contents
[
Hide
]
انشاء كائن نمط باستخدام فئة CellsFactory
يخلق الكود النموذجي التالي كائن نمط باستخدام فئة CellsFactory ثم يحدد النمط الافتراضي للمصنف. يرجى تنزيل ملف الإكسل الناتج ملف الإخراج لمراجعة نتائج هذا الكود حسب الحاجة.
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
from aspose.cells import BackgroundType, CellsFactory, Workbook | |
from aspose.pydrawing import Color | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create a Style object using CellsFactory class | |
cf = CellsFactory() | |
st = cf.create_style() | |
# Set the Style fill color to Yellow | |
st.pattern = BackgroundType.SOLID | |
st.foreground_color = Color.yellow | |
# Create a workbook and set its default style using the created Style object | |
wb = Workbook() | |
wb.default_style = st | |
# Save the workbook | |
wb.save(dataDir + "output_out.xlsx") |