In excel column has follows in json format
farm_details (Coumn name in excelsheet)
"Product1":"Zamin" (Row1)
"Product2":"Xavin" (Row2)
"Code1":"REO" (Row3)
"Code2":"RM" (Row4)
I am displaying above data in to excel i want output as follows
Product1 Product2 Code1 Code2
For getting above ouptut i written the code as follows
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(dt.Rows[0]["farm_details"].ToString());
string str = string.Empty;
int columnindex = 43;
foreach (var data in dict)
{
columnindex++;
worksheet.Cells[2, columnindex].Value = data.Key;
}
when i run the above code it shows output as follows
Product1 (Row1) only shows in the ouput in excel
i want all the Row from Row1 to Row4 Product1 Product2 Code1 Code2
for getting above output what changes i have to made. how to use for loop to get all the row.
What I have tried:
In excel column has follows in json format
farm_details (Coumn name in excelsheet)
"Product1":"Zamin" (Row1)
"Product2":"Xavin" (Row2)
"Code1":"REO" (Row3)
"Code2":"RM" (Row4)
I am displaying above data in to excel i want output as follows
Product1 Product2 Code1 Code2
For getting above ouptut i written the code as follows
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(dt.Rows[0]["farm_details"].ToString());
string str = string.Empty;
int columnindex = 43;
foreach (var data in dict)
{
columnindex++;
worksheet.Cells[2, columnindex].Value = data.Key;
}
when i run the above code it shows output as follows
Product1 (Row1) only shows in the ouput in excel
i want all the Row from Row1 to Row4 Product1 Product2 Code1 Code2
for getting above output what changes i have to made. how to use for loop to get all the row.