예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrCTHD rpt = new CrCTHD();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void hien()
        {
            if (cnn == null)
            {
                cnn = new SqlConnection(constr);
            }
            if (cnn.State == ConnectionState.Closed)
            {
                cnn.Open();
            }
            //int ma = Convert.ToInt32(txloc.Text);
            string     query = "getHoaDon";
            SqlCommand cmd   = new SqlCommand(query, cnn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@mahd", SqlDbType.NVarChar).Value = ma;
            //cmd.Parameters.AddWithValue("@action", SqlDbType.NVarChar).Value = "selectone";
            DataSet        ds = new DataSet();
            SqlDataAdapter ad = new SqlDataAdapter(cmd);
            CrCTHD         rp = new CrCTHD();

            ad.Fill(ds);
            rp.SetDataSource(ds.Tables[0]);
            crystalReportViewer1.ReportSource = rp;
        }