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

            rpt.Site = this.Site;
            return(rpt);
        }
        public void PrintData()
        {
            if (sql != null)
            {
                TotalFee = totalFeeLbl.Text;

                sql.HastaİslemleriPrintData();
                DataTable dt = new DataTable();
                dt.Columns.Add("Name", typeof(string));
                dt.Columns.Add("Surname", typeof(string));
                dt.Columns.Add("Polyclinic", typeof(string));
                dt.Columns.Add("QueueNumber", typeof(string));
                dt.Columns.Add("Hour", typeof(string));
                dt.Columns.Add("ProcessTodo", typeof(string));
                dt.Columns.Add("DrCode", typeof(string));
                dt.Columns.Add("Unit", typeof(string));
                dt.Columns.Add("UnitFee", typeof(string));
                dt.Columns.Add("TotalFee", typeof(string));
                dt.Columns.Add("DoctorName", typeof(string));
                dt.Columns.Add("DispatchDate", typeof(string));

                dt.Rows.Add(PatientName, PatientSurname, Polyclinic, QueueNumber, Hour, ProcessToDo, DoctorCode,
                            Unit, UnitFee, TotalFee, DoctorName, DispatchDate.ToShortDateString());

                PrintReport pReport = new PrintReport();
                pReport.Database.Tables["PrintTable"].SetDataSource(dt);
                CrystalReport creport = new CrystalReport();
                creport.crystalReportViewer1.ReportSource = pReport;
                creport.Show();
            }
        }