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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            SqlConnection    con;
            ConnectionString cs = new ConnectionString();
            SqlCommand       cmd;
            SDReport         rpt  = new SDReport();
            SqlDataAdapter   myDA = new SqlDataAdapter();
            softwenDS        myDS = new softwenDS();

            //The report you created.
            cmd = new SqlCommand();
            //The DataSet you created.
            con                = new SqlConnection(cs.DBConn);
            cmd.Connection     = con;
            cmd.CommandText    = "SELECT * from DbNewSales where Orderno='" + txtOrderNo.Text + "'";
            cmd.CommandType    = CommandType.Text;
            myDA.SelectCommand = cmd;
            myDA.Fill(myDS, "DbNewSales");
            // myDA.Fill(myDS, "ProductCode");
            rpt.SetDataSource(myDS);
            crystalReportViewer1.ReportSource = rpt;
            //sr.Show();
        }