تحويل Excel إلى JSON
Contents
[
Hide
]
يدعم Aspose.Cells تحويل مصنف إلى ملف Json (JavaScript Object Notation).
تحويل مصنف Excel إلى JSON
لا داعي للتساؤل عن كيفية تحويل Excel Workbook إلى JSON ، لأن مكتبة Apose.Cells for .NET لديها أفضل قرار. يوفر Aspose.Cells API دعمًا لتحويل جداول البيانات إلى تنسيق JSON. لتصدير المصنف إلى JSON ، قم بتمريرSaveFormat.Json كمعامل ثاني لـالمصنف طريقة. يمكنك أيضًا استخدام ملفاتخيارات JsonSave فئة لتحديد إعدادات إضافية لتصدير ورقة العمل إلى JSON.
يوضح مثال التعليمات البرمجية التالي تصدير مصنف Excel إلى Json. يرجى الاطلاع على الكود للتحويلمصدر الملف إلى ملف Json الذي تم إنشاؤه بواسطة الكود للرجوع إليه.
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 | |
//Load your source workbook | |
Workbook workbook = new Workbook("sample.xlsx"); | |
//Convert the workbook to json file. | |
workbook.Save("sample_out.json"); |
يوضح مثال الكود التالي الذي يستخدم فئة JsonSaveOptions لتحديد إعدادات إضافية تصدير Excel Workbook إلى Json. يرجى الاطلاع على الكود للتحويلمصدر الملف إلى ملف Json الذي تم إنشاؤه بواسطة الكود كمرجع.
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 | |
//Create an options of saving the file. | |
JsonSaveOptions options = new JsonSaveOptions(); | |
//Set the exporting range. | |
options.ExportArea = CellArea.CreateCellArea("B1", "C4"); | |
//Load your source workbook | |
Workbook workbook = new Workbook("sample.xlsx"); | |
//Convert the workbook to json file. | |
workbook.Save("sample_out.json", options); |