예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            RptSummBrandInventory rpt = new RptSummBrandInventory();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void Acc_SummaryofBrandInventoryandConsolidatedMonthlyInv()
        {
            ReportDocument rpt;
            string rptDocCachedKey = null;

            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["IRMSConnectionString"].ConnectionString);

            conn.Open();

            SqlCommand cmd = new SqlCommand();

            if (Request.QueryString["rptnameSOI"] == "rptBrandInvSumm")
            {
                rptDocCachedKey = "rptBrandInvSumm";
                if (Cache[rptDocCachedKey] != null)
                {
                    rpt = (RptSummBrandInventory)Cache[rptDocCachedKey];
                }
                else
                {
                    rpt = new RptSummBrandInventory();
                    Cache.Insert(rptDocCachedKey, rpt);
                }
                cmd.Connection = conn;
                cmd.CommandTimeout = 3000;
                cmd.CommandText = "GenRptBrandSummInventory '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "', '" + Session["USER_NAME"] + "'";
                cmd.ExecuteNonQuery();
            }
            else
            {
                rptDocCachedKey = "GenRptConsoSummaryofMonthlyInvPerBrand";
                if (Cache[rptDocCachedKey] != null)
                {
                    rpt = (RptConsoSummaryofMonthlyInvPerBrand)Cache[rptDocCachedKey];
                }
                else
                {
                    rpt = new RptConsoSummaryofMonthlyInvPerBrand();
                    Cache.Insert(rptDocCachedKey, rpt);
                }

                cmd.Connection = conn;
                cmd.CommandTimeout = 3000;
                cmd.CommandText = "GenRptSummConsoOfMonthlyInvPerBrand '" + Request.QueryString["datefrom"] + "','" + Request.QueryString["dateto"] + "','" + Session["USER_NAME"] + "'";
                cmd.ExecuteNonQuery();
            }

            DataBaseLogIn(rpt);

            ParameterField prmUserName = new ParameterField();
            ParameterField prmDateFrom = new ParameterField();
            ParameterField prmDateTo = new ParameterField();
            ParameterFields prmList = new ParameterFields();

            prmUserName.ParameterFieldName = "username";
            prmDateFrom.ParameterFieldName = "datefrom";
            prmDateTo.ParameterFieldName = "dateto";

            ParameterDiscreteValue prmUserNameValue = new ParameterDiscreteValue();
            ParameterDiscreteValue prmDateFromValue = new ParameterDiscreteValue();
            ParameterDiscreteValue prmDateToValue = new ParameterDiscreteValue();

            prmUserNameValue.Value = Session["USER_NAME"];
            prmDateFromValue.Value = Request.QueryString["datefrom"];
            prmDateToValue.Value = Request.QueryString["dateto"];

            prmUserName.CurrentValues.Add(prmUserNameValue);
            prmDateFrom.CurrentValues.Add(prmDateFromValue);
            prmDateTo.CurrentValues.Add(prmDateToValue);

            prmList.Add(prmUserName);
            prmList.Add(prmDateFrom);
            prmList.Add(prmDateTo);

            crvDailyReport.ParameterFieldInfo = prmList;
            crvDailyReport.ReportSource = rpt;
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     RptSummBrandInventory rpt = new RptSummBrandInventory();
     rpt.Site = this.Site;
     return rpt;
 }