'Xero Profit and Loss API - Parse JSON response to SQL Table not working
I am working in ASP .Net MVC, i used Xero nugut package to call api, i can not able to parse json Response .
`I am stuck on how to expand the JSON lists of arrays as columns instead of rows. Please help to retrive data from json to SQL table or in C#, Also i want to display report in html form with this data.
ListinHeaderrowCellscolumnListin the twoSectionrowsRows.1column
Any tips, hints, ideas, pointers?
{
"Reports": [
{
"ReportID": "ProfitAndLoss",
"ReportName": "Profit and Loss",
"ReportType": "ProfitAndLoss",
"ReportTitles": [
"Profit & Loss",
"Demo Company (AU)",
"1 February 2018 to 28 February 2018"
],
"ReportDate": "25 February 2018",
"UpdatedDateUTC": "\/Date(1519593468971)\/",
"Rows": [
{
"RowType": "Header",
"Cells": [
{ "Value": "" },
{ "Value": "28 Feb 18" },
{ "Value": "28 Jan 18" }
]
},
{
"RowType": "Section",
"Title": " Income",
"Rows": [
{
"RowType": "Row",
"Cells": [
{
"Value": "Sales",
"Attributes": [
{
"Value": "e2bacdc6-2006-43c2-a5da-3c0e5f43b452",
"Id": "account"
}
]
},{
"Value": "9220.05",
"Attributes": [
{
"Value": "e2bacdc6-2006-43c2-a5da-3c0e5f43b452",
"Id": "account"
}
]
},{
"Value": "5120.05",
"Attributes": [
{
"Value": "e2bacdc6-2006-43c2-a5da-3c0e5f43b452",
"Id": "account"
}
]
}
]
},
{
"RowType": "SummaryRow",
"Cells": [
{ "Value": "Total Income" },
{ "Value": "9220.05" },
{ "Value": "1250.09" }
]
}
]
},{
"RowType": "Section",
"Rows": [
{
"RowType": "Row",
"Cells": [
{ "Value": "NET PROFIT" },
{ "Value": "-6250.09" },
{ "Value": "-7250.09" }
]
}
]
}
]
}
]
}
`
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
