public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { PrintCdUpDown rpt = new PrintCdUpDown(); rpt.Site = this.Site; return(rpt); }
private void PrintUpDown_Load(object sender, EventArgs e) { if (flag == 1 && ware == "图书") { 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 = "WareUp"; adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddWithValue("@Flag", 1); data.Clear(); adapter.Fill(data.book_info); PrintBookUpDown bookup = new PrintBookUpDown(); bookup.SetDataSource(data); this.crystalReportViewer1.ReportSource = bookup; } else if (flag == 2 && ware == "光盘") { 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 = "WareUp"; adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddWithValue("@Flag", 2); data.Clear(); adapter.Fill(data.cd_info); PrintCdUpDown cdup = new PrintCdUpDown(); cdup.SetDataSource(data); this.crystalReportViewer1.ReportSource = cdup; } else if (flag == 3 && ware == "图书") { 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 = "WareDown"; adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddWithValue("@Flag", 1); data.Clear(); adapter.Fill(data.book_info); PrintBookUpDown bookdown = new PrintBookUpDown(); bookdown.SetDataSource(data); this.crystalReportViewer1.ReportSource = bookdown; } else if (flag == 4 && ware == "光盘") { 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 = "WareDown"; adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddWithValue("@Flag", 2); data.Clear(); adapter.Fill(data.cd_info); PrintCdUpDown cddown = new PrintCdUpDown(); cddown.SetDataSource(data); this.crystalReportViewer1.ReportSource = cddown; } }