How Pass Json Data From Url to Report

Stimulsoft Reports.WEB discussion
Post Reply
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

How Pass Json Data From Url to Report

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How Pass Json Data From Url to Report

Post by HighAley »

Hello.

You could specify the URL the same way as you set the file name.

Thank you.
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

Re: How Pass Json Data From Url to Report

Post 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...
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How Pass Json Data From Url to Report

Post by HighAley »

Hello.

To get DataSet from JSON string you could use next method:

Code: Select all

StiJsonToDataSetConverter.GetDataSet(Data());
Thank you.
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

Re: How Pass Json Data From Url to Report

Post by Abbas »

Thanks a lot
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: How Pass Json Data From Url to Report

Post by Andrew »

Dear Abbas,

We are glad to help you.
Post Reply