private void ReadReport(string guid, bool metadata) { SchedulerSet sc = new SchedulerSet(); sc.ReportGuid = guid; dynamic d = Controller.RetriveAsDynamic(Dict[Calls.Retriever], sc); JObject jo = null; // Special case under OData 4 - the dynamic is a list if (Controller.IsOD4) { IEnumerable <dynamic> ie = d as IEnumerable <dynamic>; foreach (var item in ie) { jo = (JObject)item; } } else { jo = d; } if (jo.Count == 1) { ReportJsonNamed rjn = new ReportJsonNamed(); rjn.CONTENT = jo.First.ToString(); ReportDownload = rjn; } else if (jo.Count == 2) { ReportJsonEDM rjd = new ReportJsonEDM(); rjd.EDM = jo.First.ToString(); rjd.CONTENT = jo.Last.ToString(); ReportDownload = rjd; } }
public void MyReports(string user) { SchedulerSet sc = new SchedulerSet(); sc.UserId = user; ReportData = new ReportData(); ReportData.ReportDatum = new List <ReportDatum>(); ReportDatum rd = Controller.RetrieveEntity <ReportDatum>(Dict[Calls.Retriever], sc); ReportData.ReportDatum.Add(rd); }