Last active
March 31, 2023 11:54
Revisions
-
aspose-com-gists revised this gist
Oct 5, 2021 . 3 changed files with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -21,5 +21,5 @@ layoutOptions.setTitleStyle(style) // import JSON data to default worksheet starting at cell A1 aspose.cells.JsonUtility.importData(jsonInput, worksheet.getCells(), 0, 0, layoutOptions) // save resultant file workbook.save("output.xlsx", aspose.cells.SaveFormat.AUTO) 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 charactersOriginal file line number Diff line number Diff line change @@ -14,5 +14,5 @@ layoutOptions.setArrayAsTable(true) // import JSON data to default worksheet starting at cell A1 aspose.cells.JsonUtility.importData(jsonInput, worksheet.getCells(), 0, 0, layoutOptions) // save resultant file workbook.save("output.xls", aspose.cells.SaveFormat.AUTO) 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1 @@ Learn how to export data from JSON to Excel in Node.js: https://blog.aspose.com/2021/09/01/convert-json-to-excel-in-nodejs/ -
aspose-com-gists created this gist
Oct 5, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // load JSON data var jsonInput = '[{"nodeId":1,"reputation":1134},{"nodeId":2,"reputation":547},{"nodeId":3,"reputation":1703},{"nodeId":4,"reputation":-199},{"nodeId":5,"reputation":-306},{"nodeId":6,"reputation":-49},{"nodeId":7,"reputation":1527},{"nodeId":8,"reputation":1223}]' // create a blank Workbook object var workbook = aspose.cells.Workbook() // access default empty worksheet var worksheet = workbook.getWorksheets().get(0) // set Styles var factory = aspose.cells.CellsFactory() style = factory.createStyle() style.getFont().setBold(true) style.getFont().setColor(aspose.cells.Color.getBlueViolet()) // set JsonLayoutOptions for formatting var layoutOptions = aspose.cells.JsonLayoutOptions() layoutOptions.setArrayAsTable(true) layoutOptions.setTitleStyle(style) // import JSON data to default worksheet starting at cell A1 aspose.cells.JsonUtility.importData(jsonInput, worksheet.getCells(), 0, 0, layoutOptions) // save resultant file in JSON-TO-XLS format workbook.save("output.xlsx", aspose.cells.SaveFormat.AUTO) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // load JSON data var jsonInput = '[{"nodeId":1,"reputation":1134},{"nodeId":2,"reputation":547},{"nodeId":3,"reputation":1703},{"nodeId":4,"reputation":-199},{"nodeId":5,"reputation":-306},{"nodeId":6,"reputation":-49},{"nodeId":7,"reputation":1527},{"nodeId":8,"reputation":1223}]' // create a blank Workbook object var workbook = aspose.cells.Workbook() // access default empty worksheet var worksheet = workbook.getWorksheets().get(0) // set JsonLayoutOptions for formatting var layoutOptions = aspose.cells.JsonLayoutOptions() layoutOptions.setArrayAsTable(true) // import JSON data to default worksheet starting at cell A1 aspose.cells.JsonUtility.importData(jsonInput, worksheet.getCells(), 0, 0, layoutOptions) // save resultant file in JSON-TO-XLS format workbook.save("output.xls", aspose.cells.SaveFormat.AUTO) 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Learn how to export data from JSON to Excel in Node.js: