Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            _cr_kasReport rpt = new _cr_kasReport();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void kasReport()
        {
            _report a    = new _report();
            string  iQry = @"select
                        date,
                        code,
                        concat(surname, ', ', firstname, ' ', middlename) name,
                        brgy,
                        sex,
                        cp_no,
                        status,
                        remarks
                        from kasambahay2
                        where date between '{0}' and '{1}'
                        and brgy like '%%{2}%%'";
            string  qry  = string.Format(iQry, dateTimePicker1.Text, dateTimePicker2.Text, comboBox5.Text);

            dataset ds = new dataset();

            using (MySqlConnection conn = new MySqlConnection(DBConn.connstring))
            {
                conn.Open();
                MySqlCommand     cmd     = new MySqlCommand(qry, conn);
                MySqlDataAdapter adapter = new MySqlDataAdapter();
                adapter.SelectCommand = cmd;
                adapter.Fill(ds, ds.Tables["kasReport"].TableName);
                _cr_kasReport rep = new _cr_kasReport();
                rep.SetDataSource(ds);
                a.crystalReportViewer1.ReportSource = rep;
                a.ShowDialog();
            }
        }