private void btnPrint_Click(object sender, EventArgs e)
 {
     if (dataGridView.Rows.Count > 0)
     {
         DataRow dr = DBConn.getCompanyNameAndAddress();
         if (dr == null)
         {
             return;
         }
         LoadData(true);
         rptAttendanceData rptObj = new rptAttendanceData();
         rptObj.SetDataSource(DS.Tables[0]);
         rptObj.SetParameterValue(0, presents);
         rptObj.SetParameterValue(1, absents);
         rptObj.SetParameterValue(4, holidays);
         rptObj.SetParameterValue(2, dr["VCOMPANY_NAME"]);
         rptObj.SetParameterValue(3, dr["VCOMPANY_ADDRESS"]);
         frmCrystalReportViewer crpt = new frmCrystalReportViewer();
         crpt.crptViewer.ReportSource = rptObj;
         crpt.Show();
     }
     else
     {
         MessageBox.Show("", "Data Not Found !", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return;
 }
Ejemplo n.º 2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptAttendanceData rpt = new rptAttendanceData();

            rpt.Site = this.Site;
            return(rpt);
        }