Beispiel #1
0
        protected void loadReport(string cachedReports)
        {
            //int rptCacheTimeout = Convert.ToInt32(ConfigurationManager.AppSettings.Get("rptCacheTimeout").ToString());
            rptMonthlyApprovedCostSheet rpt = new rptMonthlyApprovedCostSheet();
            string connectionString         = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            SqlConnectionStringBuilder connStringBuilder = new SqlConnectionStringBuilder(connectionString);

            rpt.SetDatabaseLogon(connStringBuilder.UserID, connStringBuilder.Password, connStringBuilder.DataSource, connStringBuilder.InitialCatalog);

            string                 startdate  = Request.QueryString["st"].ToString();
            string                 enddate    = Request.QueryString["ed"].ToString();
            ParameterValues        parameters = new ParameterValues();
            ParameterDiscreteValue sdate      = new ParameterDiscreteValue();
            ParameterDiscreteValue edate      = new ParameterDiscreteValue();

            sdate.Value = startdate;
            edate.Value = enddate;

            parameters.Add(sdate);
            rpt.DataDefinition.ParameterFields["Startdate"].ApplyCurrentValues(parameters);
            parameters.Add(edate);
            rpt.DataDefinition.ParameterFields["Enddate"].ApplyCurrentValues(parameters);

            //Cache.Insert(cachedReports, rpt, null, DateTime.MaxValue, TimeSpan.FromMinutes(rptCacheTimeout));
            Session[cachedReports] = rpt;
            MonthlyApprovedCostSheetReport.ReportSource = rpt;
        }
Beispiel #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rptMonthlyApprovedCostSheet rpt = new rptMonthlyApprovedCostSheet();

            rpt.Site = this.Site;
            return(rpt);
        }