public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            PPLReport rpt = new PPLReport();

            rpt.Site = this.Site;
            return(rpt);
        }
예제 #2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            SqlConnection    con;
            ConnectionString cs = new ConnectionString();
            SqlCommand       cmd;
            //frmProductPriceListReport sr = new frmProductPriceListReport();
            PPLReport      rpt  = new PPLReport();
            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 Dbinventory where Category='" + cboScategory.Text + "'";
            cmd.CommandType    = CommandType.Text;
            myDA.SelectCommand = cmd;
            myDA.Fill(myDS, "Dbinventory");
            // myDA.Fill(myDS, "ProductCode");
            rpt.SetDataSource(myDS);
            crystalReportViewer1.ReportSource = rpt;
            //sr.Show();
        }