示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptEmployeeReport rpt = new crptEmployeeReport();

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptEmployeeReport rpt = new crptEmployeeReport();
     rpt.Site = this.Site;
     return rpt;
 }
示例#3
0
        /// <summary>
        /// Function to print EmployeeReport in curresponding Crystal report
        /// </summary>
        /// <param name="dsEmployeeReport"></param>
        internal void EmployeeReportPrinting(DataSet dsEmployeeReport)
        {
            try
            {
                crptEmployeeReport crptEmployeeReport = new crptEmployeeReport();

                foreach (DataTable dtbl in dsEmployeeReport.Tables)
                {
                    if (dtbl.TableName == "Table1")
                    {
                        crptEmployeeReport.Database.Tables["dtblCompany"].SetDataSource(dtbl);
                    }
                    else if (dtbl.TableName == "Table2")
                    {
                        crptEmployeeReport.Database.Tables["dtblEmployee"].SetDataSource(dtbl);
                    }
                }
                this.crptViewer.ReportSource = crptEmployeeReport;
                SettingsSP spSettings = new SettingsSP();

                if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
                {
                    base.Show();
                    this.BringToFront();
                }
                else
                {
                    crptEmployeeReport.PrintToPrinter(1, false, 0, 0);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CRV9 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }