ID Name Questions
1 OLAM "Produto prefer":"Algodão","Plantou algodão":"Sim"
2 OLAM "Produto prefer:"Feijão Buer","Plantou algodão":"Não"
3 OLAM "Produto prefer":"Buer","Plantou algodão":"Jao"
from the above i split json quesions as follows
ID Name Produto prefer Plantou algodão
1 OLAM
2 OLAM
3 OLAM
for that i written code as follows
int columnindex = 43;
foreach (DataRow row in dtFarmerFarmReports.Rows)
{
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(row["farm_detailsdata"].ToString());
string str = string.Empty;
List<string> lst = new List<string>();
lst.AddRange(dict.Keys);
var distinctList = lst.Distinct().ToList();
foreach (var data in distinctList)
{
columnindex++;
worksheet.Cells[2, columnindex].Value = data;
}
}
i want to display the answers for each questions
i want output as follows
ID Name Produto prefer Plantou algodão
1 OLAM Algodao Sim
2 OLAM Feijao Buer Nao
3 OLAM Buer Jao
for getting below output what changes i have to made in my code to display answers.
What I have tried:
ID Name Questions
1 OLAM "Produto prefer":"Algodão","Plantou algodão":"Sim"
2 OLAM "Produto prefer:"Feijão Buer","Plantou algodão":"Não"
3 OLAM "Produto prefer":"Buer","Plantou algodão":"Jao"
from the above i split json quesions as follows
ID Name Produto prefer Plantou algodão
1 OLAM
2 OLAM
3 OLAM
for that i written code as follows
int columnindex = 43;
foreach (DataRow row in dtFarmerFarmReports.Rows)
{
var dict = JsonConvert.DeserializeObject<Dictionary<string, string>>(row["farm_detailsdata"].ToString());
string str = string.Empty;
List<string> lst = new List<string>();
lst.AddRange(dict.Keys);
var distinctList = lst.Distinct().ToList();
foreach (var data in distinctList)
{
columnindex++;
worksheet.Cells[2, columnindex].Value = data;
}
}
i want to display the answers for each questions
i want output as follows
ID Name Produto prefer Plantou algodão
1 OLAM Algodao Sim
2 OLAM Feijao Buer Nao
3 OLAM Buer Jao
for getting below output what changes i have to made in my code to display answers.