public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { RptStaffAdvanceEntry rpt = new RptStaffAdvanceEntry(); rpt.Site = this.Site; return(rpt); }
private void Button2_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; Timer1.Enabled = true; RptStaffAdvanceEntry rpt = new RptStaffAdvanceEntry(); SqlConnection myConnection = default(SqlConnection); SqlCommand MyCommand = new SqlCommand(); SqlDataAdapter myDA = new SqlDataAdapter(); DataSet myDS = new DataSet(); myConnection = new SqlConnection(cs.DBcon); MyCommand.Connection = myConnection; MyCommand.CommandText = "SELECT Employee.EMPMAXID, Employee.EmployeeName, School.SchoolName, Designations.Designation, Department.DepartmentName, AdvanceEntry.Amount, AdvanceEntry.StaffID, AdvanceEntry.AdvanceID,AdvanceEntry.Deduction, AdvanceEntry.WorkingDate FROM AdvanceEntry INNER JOIN Employee ON AdvanceEntry.StaffID = Employee.EMPID INNER JOIN School ON Employee.SchoolID = School.SchoolID INNER JOIN Designations ON Employee.Designation_ID = Designations.DesignationID INNER JOIN Department ON Employee.Department_ID = Department.DepartmentID where WorkingDate between @d1 and @d2 and Amount > 0 order by WorkingDate"; MyCommand.CommandType = CommandType.Text; myDA.SelectCommand = MyCommand; frm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }