private void ShowExceptionReport() { int month, year; if (!string.IsNullOrEmpty(DateMonth.Text)) { month = DateTime.ParseExact(DateMonth.Text, "yyyy-MM", CultureInfo.InvariantCulture).Month; year = DateTime.ParseExact(DateMonth.Text, "yyyy-MM", CultureInfo.InvariantCulture).Year; } else { month = DateTime.Now.Month; year = DateTime.Now.Year; } var u = Global.db.Streams.AsEnumerable().Where(x => x.CreatedDate.Year == year && x.CreatedDate.Month == month).OrderByDescending(x => x.TotalView).Take(3); ExceptionReportView.Reset(); DataTable dt = u != null?LinqToDataTable.LINQResultToDataTable(u) : new DataTable(); ReportDataSource rds = new ReportDataSource("ExceptionDataSet", dt); ExceptionReportView.LocalReport.DataSources.Add(rds); ExceptionReportView.LocalReport.ReportPath = Server.MapPath("~/AdminAccess/Report/ExceptionReportMostView.rdlc"); ExceptionReportView.LocalReport.SetParameters(new ReportParameter("month", CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(month))); ExceptionReportView.LocalReport.Refresh(); }
private void ShowSummaryReport(string year) { var u = Global.db.Users.AsEnumerable().Where(x => x.DateJoined.Year.ToString() == year).OrderByDescending(x => x.DateJoined); SummaryReportView.Reset(); DataTable dt = u != null?LinqToDataTable.LINQResultToDataTable(u) : new DataTable(); ReportDataSource rds = new ReportDataSource("SummaryDataSet", dt); SummaryReportView.LocalReport.DataSources.Add(rds); SummaryReportView.LocalReport.ReportPath = Server.MapPath("~/AdminAccess/Report/SummaryReport.rdlc"); SummaryReportView.LocalReport.SetParameters(new ReportParameter("year", year)); SummaryReportView.LocalReport.SetParameters(new ReportParameter("totalRegistration", u.Count().ToString())); SummaryReportView.LocalReport.Refresh(); }
private void ShowDetailReport(string name) { var seller = Global.db.Sellers.FirstOrDefault(x => x.Name.Contains(name)); var u = seller != null ? Global.db.OrderSales.Where(x => x.SellerName == seller.Name) : null; DetailReportView.Reset(); DataTable dt = u != null?LinqToDataTable.LINQResultToDataTable(u) : new DataTable(); ReportDataSource rds = new ReportDataSource("DetailDataSet", dt); DetailReportView.LocalReport.DataSources.Add(rds); DetailReportView.LocalReport.ReportPath = Server.MapPath("~/AdminAccess/Report/DetailReport.rdlc"); DetailReportView.LocalReport.Refresh(); }