public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CRRak rpt = new CRRak(); rpt.Site = this.Site; return(rpt); }
private void button1_Click(object sender, EventArgs e) { var cr = crystalReportViewer1; if (cb_jenis.SelectedIndex == 0) { CRRak report = new CRRak(); report.RecordSelectionFormula = "{rak.id_rak} >= '" + cb_filter_1.SelectedValue.ToString() + "' and " + "{rak.id_rak} <= '" + cb_filter_2.SelectedValue.ToString() + "'"; cr.ReportSource = report; } else { CRBarang report = new CRBarang(); report.RecordSelectionFormula = "{barang.id_barang} >= '" + cb_filter_1.SelectedValue.ToString() + "' and " + "{barang.id_barang} <= '" + cb_filter_2.SelectedValue.ToString() + "'"; cr.ReportSource = report; } cr.RefreshReport(); }