JsonUtility.ImportData
JsonUtility.ImportData method
Import the json string.
public static int[] ImportData(string json, Cells cells, int row, int column,
JsonLayoutOptions option)
Parameter | Type | Description |
---|---|---|
json | String | The json string. |
cells | Cells | The Cells. |
row | Int32 | The row index. |
column | Int32 | The column index. |
option | JsonLayoutOptions | The options of import json string. |
Examples
using System;
using Aspose.Cells;
using Aspose.Cells.Utility;
namespace AsposeCellsExamples
{
public class JsonUtilityMethodImportDataWithStringCellsInt32Int32JsonLayouDemo
{
public static void Run()
{
string jsonInput = "[{"
+ "\"Name\" : \"Name\","
+ "\"DisplayName\" : \"DisplayName\","
+ "\"ShowDisplayName\" : false"
+ "},"
+ "{"
+ "\"Name\" : \"Nameone\","
+ "\"DisplayName\" : \"DisplayNameone\","
+ "\"ShowDisplayName\" : true"
+ "},"
+ "{"
+ "\"Name\" : \"Nametwo\","
+ "\"DisplayName\" : \"DisplayNametwo\","
+ "\"ShowDisplayName\" : false"
+ "}]";
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
JsonLayoutOptions options = new JsonLayoutOptions();
options.ArrayAsTable = true;
JsonUtility.ImportData(jsonInput, worksheet.Cells, 0, 0, options);
workbook.Save("output.xlsx");
}
}
}
See Also
- class Cells
- class JsonLayoutOptions
- class JsonUtility
- namespace Aspose.Cells.Utility
- assembly Aspose.Cells