تحويل JSON إلى Excel
Contents
[
Hide
]
Aspose.Cells for Python via Java يدعم تحويل ملف Json (JavaScript Object Notation) إلى Excel Workbook.
تحويل JSON إلى مصنف Excel
لا داعي للتساؤل عن كيفية تحويل JSON إلى ملف Excel ، لأن مكتبة Aspose.Cells for Python via Java لديها القرار الأفضل. يوفر Aspose.Cells for Python via Java API دعمًا لتحويل تنسيق JSON إلى جداول بيانات. يمكنك استخدامJsonLoadOptions فئة لتحديد إعدادات إضافية لاستيراد JSON إلى المصنف.
يوضح مثال التعليمات البرمجية التالي استيراد JSON إلى Excel Workbook. يرجى الاطلاع على الكود للتحويلمصدر الملف إلى الملف الذي تم إنشاؤه بواسطة الكود كمرجع.
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
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook | |
# Load Source JSON file | |
workbook = Workbook("sample.json") | |
# Save file to xlsx format | |
workbook.save("sample_out.xlsx") | |
jpype.shutdownJVM() |
يوضح مثال الكود التالي الذي يستخدم فئة JsonLoadOptions لتحديد إعدادات إضافية استيراد JSON إلى Excel Workbook. يرجى الاطلاع على الكود للتحويلمصدر الملف إلى ملف xlsx الذي تم إنشاؤه بواسطة الكود كمرجع.
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
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, JsonLoadOptions | |
# Create an options of loading the file. | |
options = JsonLoadOptions() | |
# Indicates whether importing each attribute of JsonObject object as one worksheet when all child nodes are array nodes. | |
options.setMultipleWorksheets(True) | |
book = Workbook("sample.json", options) | |
# save file to xlsx format | |
book.save("sample_out2.xlsx") | |
jpype.shutdownJVM() |