コード例 #1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (txtPkid.Text == "")
            {
                glb_function.MsgBox("الرجاء اختيار القيد");
                return;
            }

            cryRepVoucher      report   = new cryRepVoucher();
            frmReportContainer frm      = new frmReportContainer();
            DataTable          dtReport = new DataTable();
            TextObject         txtTitel = (TextObject)report.ReportDefinition.ReportObjects["txtReportTitel"];

            txtTitel.Text = "قيد افتتاحي";
            ConnectionToMySQL cnn = new ConnectionToMySQL();

            dtReport = cnn.GetDataTable("select h.pkid,h.jour_no,h.trans_name,date_format(h.jour_date,'%d/%m/%Y') jour_date,h.jour_note, a.Acc_no,a.acc_name, " +
                                        " if (d.main_value > 0,d.main_value,0) Dept,if (d.main_value < 0,d.main_value * -1,0) Credit,d.jour_details " +
                                        " from journal_header h " +
                                        "  join journal_details d on(h.pkid= d.header_id) " +
                                        "  join accounts a on(a.pkid= d.acc_id) " +
                                        " where h.pkid=  " + txtPkid.Text);



            report.SetDataSource(dtReport);
            ////// report.SetParameterValue("P_Date", (ckbSelectDate.IsChecked == true ? " من تاريخ : " + dtpFrom.SelectedDate.Value.ToString("dd/MM/yyyy") + " إلى تاريخ : " + dtpTo.SelectedDate.Value.ToString("dd/MM/yyyy") : ""));
            frm.CrystalReportsViewer1.ReportSource = report;
            frm.ShowDialog();
        }
コード例 #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     cryRepVoucher rpt = new cryRepVoucher();
     rpt.Site = this.Site;
     return rpt;
 }