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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void collReporty()
        {
            _report a            = new _report();
            string  iQry         = @"SELECT
                            date `DATE`,
                            code `CODE`,
                            concat(surname, ', ', firstname, ' ', middlename) `NAME`,
                            sex `GENDER`,
                            dob `BOD`,
                            mother `MOTHERNAME`,
                            father `FATHERNAME`,
                            brgy `ADDRESS`,
                            cp_no `CONTACT`,
                            school `SCHOOL`,
                            yearlevel `YEAR`,
                            ave `AVE`,
                            status `STATUS`
                            FROM schoolar_coll
                            where date between '{0}' and '{1}'
                            and brgy like '%%{2}%%'
                            and school like '%%{3}%%'
                            and status like '%%{4}%%'
                            group by code";
            string  qry          = string.Format(iQry, dateTimePicker1.Text, dateTimePicker2.Text, comboBox5.Text, textBox6.Text, comboBox1.Text);
            string  datasetTable = "colReport";

            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[datasetTable].TableName);
                _cr_colReport2 rep = new _cr_colReport2();
                rep.SetDataSource(ds);
                a.crystalReportViewer1.ReportSource = rep;
                a.ShowDialog();
            }
        }