Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptStockLedger rpt = new rptStockLedger();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (rdoStockLedger.Checked)
            {
                ReportDocument objRptDoc = new ReportDocument();
                //IMasterList objStockLedger = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
                ISCMReport objStockLedger = (ISCMReport)ObjectFactory.CreateInstance("BusinessProcess.SCM.BSCMReport,BusinessProcess.SCM");
                DataSet    theDS          = objStockLedger.GetStockLedgerData(Convert.ToInt32(ddlStore.SelectedValue), Convert.ToDateTime(dtpFrom.Text), Convert.ToDateTime(dtpTo.Text));
                theDS.WriteXmlSchema(GblIQCare.GetXMLPath() + "\\StockLedger.xml");
                rptStockLedger rep = new rptStockLedger();
                rep.SetDataSource(theDS);
                //  rep.ParameterFields["FormDate","1"];
                rep.SetParameterValue("FromDate", dtpFrom.Text);
                rep.SetParameterValue("ToDate", dtpTo.Text);
                rep.SetParameterValue("ToClosingDate", (Convert.ToString(dtpTo.Text)).Replace('-', ' '));
                rep.SetParameterValue("facilityname", GblIQCare.AppLocation);

                // , Convert.ToString(dtpFrom.Text)];

                frmReportViewer theRepViewer = new frmReportViewer();
                theRepViewer.MdiParent             = this.MdiParent;
                theRepViewer.Location              = new Point(0, 0);
                theRepViewer.crViewer.ReportSource = rep;
                theRepViewer.Show();
                this.Close();
            }
        }