public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { raporcari rpt = new raporcari(); rpt.Site = this.Site; return(rpt); }
private void button1_Click(object sender, EventArgs e) { suankitarih = DateTime.Now.ToShortDateString().ToString(); int gun = -1 * Int32.Parse(gerigun); string labelTarih = suankitarih; var tarih = DateTime.Parse(labelTarih).AddDays(gun); geritarih = tarih.ToString(); if (comboBox1.SelectedIndex == 0) { if (radioButton1.Checked) { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from SATIS_EKRANI where barkod_no='" + textBox1.Text + "'", baglan); adp.Fill(tb); baglan.Close(); raporsatis rpr = new raporsatis(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } else if (radioButton2.Checked) { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from SATIS_EKRANI where musteri_adi='" + textBox2.Text + "'", baglan); adp.Fill(tb); baglan.Close(); raporsatis rpr = new raporsatis(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } else if (radioButton3.Checked) { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from SATIS_EKRANI where tarih between '" + dateTimePicker1.Value.ToString() + "' and '" + dateTimePicker2.Value.ToString() + "'", baglan); adp.Fill(tb); baglan.Close(); raporsatis rpr = new raporsatis(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } else { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from SATIS_EKRANI", baglan); adp.Fill(tb); baglan.Close(); raporsatis rpr = new raporsatis(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } } if (comboBox1.SelectedIndex == 1) { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from CARI_BILGI", baglan); adp.Fill(tb); baglan.Close(); raporcari rpr = new raporcari(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } if (comboBox1.SelectedIndex == 2) { if (checkBox1.Checked) { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from HAREKETLER", baglan); adp.Fill(tb); baglan.Close(); raporhareket rpr = new raporhareket(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } else { baglan.Open(); DataTable tb = new DataTable(); OleDbDataAdapter adp = new OleDbDataAdapter("select * from HAREKETLER where TARIH >='" + geritarih + "'", baglan); adp.Fill(tb); baglan.Close(); raporhareket rpr = new raporhareket(); rpr.SetDataSource(tb); crystalReportViewer1.ReportSource = rpr; } } }