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

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        // genarate Stock Demand report
        public static ReportClass StockDemand(DateTime?from, DateTime?To)
        {
            OdbcDataAdapter reportAdapter;
            DataSet         reportDataSet;
            ReportClass     currentReport = null;

            reportAdapter = new OdbcDataAdapter("call StockDemand(?,?)", DBConnection.getConnection());
            reportAdapter.SelectCommand.Parameters.Add("@from", OdbcType.VarChar).Value = (from == null)?"":String.Format("{0:yyyy-MM-dd}", from);
            reportAdapter.SelectCommand.Parameters.Add("@to", OdbcType.VarChar).Value   = (To == null) ? "" : String.Format("{0:yyyy-MM-dd}", To);
            reportDataSet = new reportDS();
            reportAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;
            reportAdapter.Fill(reportDataSet, "StockDemand");
            if (reportDataSet.Tables["StockDemand"].Rows.Count > 0)
            {
                currentReport = new RptStockDemand();
                currentReport.SetDataSource(reportDataSet);
            }
            return(currentReport);
        }