Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hello
i have data like i posted bellow i need to convert it to excel file
i tried most of online solutions but there is no result any help please ?
json data :
JavaScript
{
	"id": "0001",
	"type": "donut",
	"name": "Cake",
	"ppu": 0.55,
	"batters":
		{
			"batter":
				[
					{ "id": "1001", "type": "Regular" },
					{ "id": "1002", "type": "Chocolate" },
					{ "id": "1003", "type": "Blueberry" },
					{ "id": "1004", "type": "Devil's Food" }
				]
		},
	"topping":
		[
			{ "id": "5001", "type": "None" },
			{ "id": "5002", "type": "Glazed" },
			{ "id": "5005", "type": "Sugar" },
			{ "id": "5007", "type": "Powdered Sugar" },
			{ "id": "5006", "type": "Chocolate with Sprinkles" },
			{ "id": "5003", "type": "Chocolate" },
			{ "id": "5004", "type": "Maple" }
		]
}
Posted
v2
Comments
Tell us what exactly you have tried and where you failed?
osamafadl 19-May-15 7:53am    
i tried this http://www.codeproject.com/Tips/565920/Create-CSV-from-JSON-in-Csharp
but i have complex json like i refered
Garth J Lancaster 19-May-15 7:25am    
i'ts all very well to produce a json file and say 'turn it into excel' .. but you need to specify how you'd like it to appear in excel - for example, do you wish for
a) 1 tab called 'batter', with two columns of information [id, type], another tab called 'topping' with two columns of information [id, type]
b) something else ?
osamafadl 19-May-15 7:54am    
nested object apperead like [object,object]

1 solution

This is data that can not be displayed on an Excel sheet as Excel can only display simple table, where you have a multilevel data structure...
If what you mean is to use the second-level values for validation, you have two options:
1. Do it directly on the Excel sheet using the Validation dialog - https://support.office.com/en-nz/article/Apply-data-validation-to-cells-c743a24a-bc48-41f1-bd92-95b6aeeb73c9[^]
2. Learn using VSTO for creating Excel sheet from code: https://msdn.microsoft.com/en-us/library/office/fp179694.aspx[^]
 
Share this answer
 
Comments
osamafadl 19-May-15 8:00am    
i need to show in excel header row and each row detail that waht i need

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900