private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { DataSet ds = new DataSet(); String strMonth = cmbMonth.Text; DateTime dtDate = new DateTime(Convert.ToInt32(cmbYear.SelectedValue.ToString()), Convert.ToInt32(cmbMonth.SelectedValue.ToString()), 1); DateTime dtPreviousDate = dtDate.AddDays(-1); ds = myRep.GetInactiveEmployeesDebts(cmbYear.Text, dtPreviousDate.Month); if (ds.Tables[0].Rows.Count > 0) { ds.WriteXml("InactiveEmpDebts.xml"); InactiveEmployeeDebts myDebts = new InactiveEmployeeDebts(); myDebts.SetDataSource(ds); ReportViewer myViewer = new ReportViewer(); myDebts.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName()); myDebts.SetParameterValue("Estate", "Estate :" + myDiv.ListEstates().Rows[0][0].ToString()); myDebts.SetParameterValue("Period", "Month of " + cmbMonth.Text + "/" + cmbYear.Text); myViewer.crystalReportViewer1.ReportSource = myDebts; myViewer.Show(); } else { MessageBox.Show("No Data Preview..!"); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { InactiveEmployeeDebts rpt = new InactiveEmployeeDebts(); rpt.Site = this.Site; return(rpt); }