public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { PrintCdBack rpt = new PrintCdBack(); rpt.Site = this.Site; return(rpt); }
private void PrintBackReturnBad_Load(object sender, EventArgs e)//初始化打印 { if (flag == 1) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from bookbackprovider", connect); data.Clear(); adapter.Fill(data.book_back); PrintBookBack bookback = new PrintBookBack(); bookback.SetDataSource(data); this.crystalReportViewer1.ReportSource = bookback; } else if (flag == 2) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from cdbackprovider", connect); data.Clear(); adapter.Fill(data.cd_back); PrintCdBack cdback = new PrintCdBack(); cdback.SetDataSource(data); this.crystalReportViewer1.ReportSource = cdback; } else if (flag == 3) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from bookreturnme", connect); data.Clear(); adapter.Fill(data.book_return); PrintBookReturn bookreturn = new PrintBookReturn(); bookreturn.SetDataSource(data); this.crystalReportViewer1.ReportSource = bookreturn; } else if (flag == 4) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from cdreturnme", connect); data.Clear(); adapter.Fill(data.cd_return); PrintCdReturn cdreturn = new PrintCdReturn(); cdreturn.SetDataSource(data); this.crystalReportViewer1.ReportSource = cdreturn; } else if (flag == 5) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from bookbadme", connect); data.Clear(); adapter.Fill(data.book_bad); PrintBookBad bookbad = new PrintBookBad(); bookbad.SetDataSource(data); this.crystalReportViewer1.ReportSource = bookbad; } else if (flag == 6) { SqlConnection connect = InitConnect.GetConnection(); MyDataSet data = new MyDataSet(); SqlDataAdapter adapter = new SqlDataAdapter("select * from cdbadme", connect); data.Clear(); adapter.Fill(data.cd_bad); PrintCdBad cdbad = new PrintCdBad(); cdbad.SetDataSource(data); this.crystalReportViewer1.ReportSource = cdbad; } }