private void butshow_Click(object sender, EventArgs e) { temp(); string str = " 1 = 1"; if (combpro4.SelectedIndex == 0) { str = "where cusID='" + combcust4.SelectedValue + "' "; } else { str = " where cusID='" + combcust4.SelectedValue + "'and proID='" + combpro4.SelectedValue + "' "; } // get fist comm report form ReportForm frm = new ReportForm(); ledgerReportCR rpt = new ledgerReportCR(); // get data from sql //str ="select Customer,Product,cusID,proID,CONVERT(VARCHAR, Submit_date,103) AS Submit_date,Amount,Total,balance_left from cash_book"; DataTable dt = new DataTable(); SqlDataAdapter Da2 = new SqlDataAdapter("select cash_book.Customer,cash_book.Product,cusID,proID,CONVERT(VARCHAR, Submit_date,103) AS Submit_date,Amount,Total,AdvanceCost from cash_book inner join purchase on purchase.Purchase_id=cash_book.Pur_ID " + str, Class1.Cnn); Da2.Fill(dt); // set data for report object rpt.SetDataSource(dt); // set report for showing object (crystal report viwer) frm.crystalReportViewer1.ReportSource = rpt; // show report form frm.ShowDialog(); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { ledgerReportCR rpt = new ledgerReportCR(); rpt.Site = this.Site; return(rpt); }