الجمع بين مصنفات متعددة في مصنف واحد
Contents
[
Hide
]
في بعض الأحيان ، تحتاج إلى دمج المصنفات مع محتويات مختلفة مثل الصور والمخططات والبيانات في مصنف واحد. Aspose.Cells يدعم هذه الميزة. يوضح هذا المقال كيفية إنشاء تطبيق وحدة التحكم في Visual Studio والجمع بين المصنفات مع بضعة سطور بسيطة من التعليمات البرمجية باستخدام Aspose.Cells.
الجمع بين المصنفات والصور والرسوم البيانية
يجمع رمز المثال بين مصنفين في مصنف واحد باستخدام Aspose.Cells. يقوم الرمز بتحميل المصنفات المصدر ، ويستخدمWorkbook.combine ()طريقة لدمجها وحفظ مصنف الإخراج.
المصنفات المصدر
مصنفات الإخراج
لقطات
فيما يلي لقطات شاشة للمصنفات المصدر والمخرجات.
يمكنك استخدام أي مصنفات مصدر. هذه الصور هي فقط لأغراض التوضيح.
ورقة العمل الأولى من مصنف المخططات - مكدسة
ورقة العمل الثانية من مصنف المخططات - سطر
أول ورقة عمل من مصنف صورة - صورة
جميع أوراق العمل الثلاثة في المصنف المدمج - مكدسة ، خطية ، صورة
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Define the first source | |
// Open the first excel file. | |
Workbook SourceBook1 = new Workbook(dataDir+ "SampleChart.xlsx"); | |
// Define the second source book. | |
// Open the second excel file. | |
Workbook SourceBook2 = new Workbook(dataDir+ "SampleImage.xlsx"); | |
// Combining the two workbooks | |
SourceBook1.Combine(SourceBook2); | |
dataDir = dataDir + "Combined.out.xlsx"; | |
// Save the target book file. | |
SourceBook1.Save(dataDir); |