Beispiel #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            PrintBookSale rpt = new PrintBookSale();

            rpt.Site = this.Site;
            return(rpt);
        }
Beispiel #2
0
 private void PrintWareSale_Load(object sender, EventArgs e)
 {
     if (ware.Trim() == "图书")
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintBookSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", begindate);
         adapter.SelectCommand.Parameters.AddWithValue("@date2", enddate);
         data.Clear();
         adapter.Fill(data.book_sale);
         PrintBookSale booksale = new PrintBookSale();
         booksale.SetDataSource(data);
         this.crystalReportViewer1.ReportSource = booksale;
     }
     else
     {
         SqlConnection  connect = InitConnect.GetConnection();
         MyDataSet      data    = new MyDataSet();
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     select  = new SqlCommand();
         adapter.SelectCommand             = select;
         adapter.SelectCommand.Connection  = connect;
         adapter.SelectCommand.CommandText = "PrintCdSale";
         adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
         adapter.SelectCommand.Parameters.AddWithValue("@date1", begindate);
         adapter.SelectCommand.Parameters.AddWithValue("@date2", enddate);
         data.Clear();
         adapter.Fill(data.cd_sale);
         PrintCdSale cdsale = new PrintCdSale();
         cdsale.SetDataSource(data);
         this.crystalReportViewer1.ReportSource = cdsale;
     }
 }