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

            rpt.Site = this.Site;
            return(rpt);
        }
        protected void loadReport(string cachedReports)
        {
            //int rptCacheTimeout = Convert.ToInt32(ConfigurationManager.AppSettings.Get("rptCacheTimeout").ToString());
            rptWorkerList  rpt = new rptWorkerList();
            string         connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            SqlConnection  connection       = new SqlConnection(connectionString);
            SqlDataAdapter adapter          = new SqlDataAdapter();
            DataSet        ds = new DataSet();

            adapter = new SqlDataAdapter("select * from vwWorkerList where WorkerType = 'D'", connection);
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }
            adapter.Fill(ds, "vwWorkerList");
            rpt.SetDataSource(ds);

            adapter.Dispose();
            connection.Dispose();
            //Cache.Insert(cachedReports, rpt, null, DateTime.MaxValue, TimeSpan.FromMinutes(rptCacheTimeout));
            Session[cachedReports]        = rpt;
            WorkerListReport.ReportSource = rpt;
        }