or
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "ReportService" in code, svc and config file together. [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class ReportService : IReportService { public void DoWork() { } private byte[] RenderToArray(string instanceID) { Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); //set any deviceInfo settings if necessary System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = new PowerBrowser.Web.Modules.Reporting.ReportZakenDashboard(); Telerik.Reporting.Processing.RenderingResult renderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); string fileName = renderingResult.DocumentName + "." + renderingResult.Extension; string path = System.IO.Path.GetTempPath(); string filePath = System.IO.Path.Combine(path, fileName); byte[] result = new byte[renderingResult.DocumentBytes.Length]; using (System.IO.MemoryStream fs = new System.IO.MemoryStream(result)) { fs.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.Length); } return result; } public Telerik.Reporting.Service.PageInfo GetPage(string instanceID, int pageNumber) { PageInfo info = new PageInfo() { Buffer = RenderToArray(""), PageNumber = 1 }; return info; } public List<Parameter> GetReportParameters(string report, NameValueDictionary deviceInfo, NameValueDictionary parameters) { List<Parameter> reportParameters = new List<Parameter>(); return reportParameters; } public IList<ReportInfo> ListAvailableReports() { ReportInfo info = new ReportInfo() { Description = "Mijn zaken", FullName = "Rapport - Mijn zaken", Name = "ReportZakenDashboard" }; List<ReportInfo> reports = new List<ReportInfo>(); reports.Add(info); return reports; } public IList<ExtensionInfo> ListRenderingExtensions() { List<ExtensionInfo> extensions = new List<ExtensionInfo>(); ExtensionInfo info = new ExtensionInfo() { LocalizedName = "PDF", Name = "PDF" }; extensions.Add(info); return extensions; } public RenderingResult Render(string format, string report, NameValueDictionary deviceInfo, NameValueDictionary parameters) { RenderingResult renderingResult = null; if (report == "ReportZakenDashboard") { renderingResult = new RenderingResult() { DocumentBytes = new byte[] { }, DocumentName = "Test", Extension = "PDF", }; } return renderingResult; } public RenderingSessionInfo RenderAndCache(string format, string report, NameValueDictionary deviceInfo, NameValueDictionary parameters) { RenderingSessionInfo info = new RenderingSessionInfo() { PageCount = 1, DocumentName = "Mijn zaken", PageNumber = 1, Report = "ReportZakenDashboard" }; return info; } }
var recipientContact = from ro in recipientOrg.AsEnumerable() join rc in _db.RecipientContacts on ro.RecipientOrganizationID equals rc.RecipientOrganizationID select new { OrgName = rc.RecipientOrganization.Name, ContactName = rc.FirstName + " " + rc.Surname, Address1 = rc.Address1, Address2 = rc.Address2, City = rc.City.CityName, Province = rc.Province.NameEnglish, Country = rc.Country.CountryName, PostalCode = rc.PostalCode, Fax = ro.FaxNumber, Phone = ro.PhoneNumber }; table5.DataSource = recipientContact.ToList(); private void table5_ItemDataBound(object sender, EventArgs eventArgs) { }<telerik:ReportViewer Name="telerikPersonReport" Height="275" />public void LoadTelericReport(){ Telerik.Reporting.EntityDataSource entityDataSource = new Telerik.Reporting.EntityDataSource(); ReportEntity objectContext = new ReportEntity(); entityDataSource.ObjectContext = objectContext; entityDataSource.ObjectContextMember = "Events"; Telerik.Reporting.Report report = new Telerik.Reporting.Report(); report.DataSource = entityDataSource; Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource(); reportSource.ReportDocument = report; telerikPersonReport.ReportSource = reportSource; telerikPersonReport.RefreshReport();}public class ReportEntity { Attendance_Tracker ThisData = new Attendance_Tracker(); public ReportEntity() { ThisData.Attendances.Load(); ThisData.Attendees.Load(); ThisData.Events.Load(); ThisData.Sessions.Load(); } public List<EventType> Events() { var AllEvents = from e in ThisData.Events.Local select new EventType() { EventID = e.EventID, EventName = e.EventName, StartDate = e.StartDate, EndDate = e.EndDate, count = (from a in ThisData.Attendances.Local where a.Session.Event == e select a).Count() }; return AllEvents.ToList(); }}