Convert-Excel-to-JSON
Contents
[
Hide
]
Aspose.Cells は、ワークブックを Json (JavaScript Object Notation) ファイルに変換することをサポートしています。
Excel ワークブックを JSON に変換
Aspose.Cells Java ライブラリが最適な決定を行うため、Excel ワークブックを JSON に変換する方法を考える必要はありません。 Aspose.Cells Java API は、スプレッドシートを JSON 形式に変換するためのサポートを提供します。ワークブックを JSON にエクスポートするには、次を渡します。SaveFormat.JSONの 2 番目のパラメータとして[Workbook.save](https://reference.aspose.com/cells/java/com.aspose.cells/workbook#save(java.lang.String,%20int) ) 方法。使用することもできますJsonSaveOptionsクラスを使用して、ワークシートを 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
//Load Source Excel file | |
Workbook workbook = new Workbook("sample.xlsx"); | |
//Save the workbook in JSON format | |
workbook.save("sample_out.json", SaveFormat.JSON); |
JsonSaveOptions クラスを使用して追加の設定を指定する次のコード例は、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
//Create an options of saving the file. | |
JsonSaveOptions options = new JsonSaveOptions(); | |
//Set the exporting range. | |
options.setExportArea(CellArea.createCellArea("B1", "C4")); | |
//Load Source Excel file | |
Workbook workbook = new Workbook("sample.xlsx"); | |
//Save the workbook in JSON format | |
workbook.save("sample_out.json", options); |