Page 1 of 1
How Pass Json Data From Url to Report
Posted: Wed Oct 14, 2015 4:55 am
by Abbas
Hi,
I have a Web App with MVC And I want to create report that its datasource is json data but i have problem...
I can pass a json file to a report but in this scenario my json data produce in action method and reachable by a url...now how can i pass this json data that url return to a report??
thanks a lot
Re: How Pass Json Data From Url to Report
Posted: Wed Oct 14, 2015 7:19 am
by HighAley
Hello.
You could specify the URL the same way as you set the file name.
Thank you.
Re: How Pass Json Data From Url to Report
Posted: Wed Oct 14, 2015 11:40 am
by Abbas
thank you for your reply
but its doesn't work....for example when i pass json file to report , I use this code:
Code: Select all
var Dset=StiJsonToDataSetConverter.GetDataSetFromFile(@"E:\Json\Demo.Json");
report.RegData(Dset);
this works correctly
but when I want to use json from method like this
Code: Select all
public string Data()
{
var lst = new List<person>();
for (int i = 0; i < 10; i++)
{
lst.Add(new person {Name = "Ali" + 1, Family = "Ahmadi" + i});
}
return JsonConvert.SerializeObject(lst);
}
I cant use it....
thank you...
Re: How Pass Json Data From Url to Report
Posted: Thu Oct 15, 2015 9:33 am
by HighAley
Hello.
To get DataSet from JSON string you could use next method:
Code: Select all
StiJsonToDataSetConverter.GetDataSet(Data());
Thank you.
Re: How Pass Json Data From Url to Report
Posted: Sun Oct 18, 2015 1:02 pm
by Abbas
Thanks a lot
Re: How Pass Json Data From Url to Report
Posted: Mon Oct 19, 2015 5:46 am
by Andrew
Dear Abbas,
We are glad to help you.