Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            FieldWiseDivisionNormRPT1 rpt = new FieldWiseDivisionNormRPT1();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataTable dsDivisionReport = new DataTable();

            //dsDivisionReport = myEmployeeDeduction.GetMonthPRINorms(cmbDivision.SelectedValue.ToString(), new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1), new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1).AddMonths(1).AddDays(-1)).Tables[0];
            dsDivisionReport = myEmployeeDeduction.GetMonthPRINormsForCrossTab(cmbDivision.SelectedValue.ToString(), new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1), new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1).AddMonths(1).AddDays(-1), cmbCropType.Text).Tables[0];
            if (dsDivisionReport.Rows.Count > 0)
            {
                dsDivisionReport.WriteXml("MonthPRINorm.xml");

                FieldWiseDivisionNormRPT1 objReport = new FieldWiseDivisionNormRPT1();
                objReport.SetDataSource(dsDivisionReport);
                ReportViewerForm objReportViewer = new ReportViewerForm();

                objReport.SetParameterValue("Estate", EstDiv.ListEstates().Rows[0][0].ToString());
                objReport.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName());
                objReport.SetParameterValue("Division", cmbDivision.SelectedValue.ToString());
                objReport.SetParameterValue("Period", new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1).ToShortDateString() + " To " + new DateTime(dateTimePicker1.Value.Date.Year, dateTimePicker1.Value.Date.Month, 1).AddMonths(1).AddDays(-1).ToShortDateString());
                objReportViewer.crystalReportViewer1.ReportSource = objReport;
                objReportViewer.Show();
            }
            else
            {
                MessageBox.Show("No Data To Preview.");
            }
        }