Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            cryRepInventoryIn rpt = new cryRepInventoryIn();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnPrint_Click(object sender, EventArgs e)
        {
            if (txtPkid.Text == "")
            {
                glb_function.MsgBox("الرجاء اختيار الأمر");
                return;
            }
            string strTitel = "";

            if (strStackadj_type == "امر توريد")
            {
                strTitel = "أمر توريد مخزني";
            }
            else
            {
                strTitel = "أمر صرف مخزني";
            }



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

            txtCurrency.Text = strTitel;

            ConnectionToMySQL cnn = new ConnectionToMySQL();

            dtReport = cnn.GetDataTable("SELECT h.pkid,h.stockadj_no,h.warehosue_id,h.stackadj_note,date_format(h.created_date,'%d/%m/%Y') created_date, " +
                                        " d.pkid dpkid, d.itemid, d.qty, " +
                                        " i.itemno, i.itemname, i.UnitSellingPrice, i.unitCost, " +
                                        " a.pkid acc_id, a.Acc_no, a.acc_name, " +
                                        " w.warehouse_name " +
                                        " FROM stockadjust_header h " +
                                        " join stockadjust_details d on(h.pkid = d.header_id) " +
                                        " join items i on(d.itemid = i.pkid) " +
                                        " join accounts a on(a.pkid = h.acc_id) " +
                                        " join warehouse w on(w.pkid = h.warehosue_id) " +
                                        " and h.pkid =   " + txtPkid.Text);



            report.SetDataSource(dtReport);
            frm.CrystalReportsViewer1.ReportSource = report;



            frm.ShowDialog();
        }