public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { BulkReportForAdmin rpt = new BulkReportForAdmin(); rpt.Site = this.Site; return(rpt); }
private void BulkReport() { try { using (SqlConnection con = new SqlConnection(ConnString)) { using (SqlCommand cmd = new SqlCommand("GetBulkOrderReport", con)) { AppConfiguration a = new AppConfiguration(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@FromDate", a.ReportFromDate); cmd.Parameters.AddWithValue("@ToDate", a.ReportToDate); cmd.CommandTimeout = 0; con.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { BulkReportForAdmin rpt = new BulkReportForAdmin(); rpt.SetDataSource(dt); crystalReportViewer1.ShowGroupTreeButton = false; crystalReportViewer1.ToolPanelView = ToolPanelViewType.None; crystalReportViewer1.ReportSource = rpt; } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error); } }