Exemplo n.º 1
0
        public ContentResult Report()
        {
            var s = new JsonSerializer<List<ConnectionStringConfig>>();

            var x = s.DeserializeFromReader(new StreamReader(HttpContext.Server.MapPath("../json") +  "\\" + "ConnectionStrings.json"));
            var reportConfig = new SqlReportConfig { ReportTemplateRoot = HttpContext.Server.MapPath("../sql") + "\\", ReportName = "employeeList", ConnectionString = "Data Source=CORPSPLRPTDB1;Initial Catalog=ApplicationLog;Persist Security Info=True;Trusted_Connection=True;" };
            var jsonHtmlTableGenerator = new JsonHtmlTableGenerator(reportConfig);
            var jsonHtmlTable = jsonHtmlTableGenerator.GetJsonTable(JsonHtmlTableType.DataTables);

            return new ContentResult { Content = jsonHtmlTable, ContentType = "application/json" };
        }
Exemplo n.º 2
0
        private SqlReportConfig BaseReportConfig()
        {
            const string cachedConfigKey = "BaseReportConfig";
            var reportConfig = System.Web.HttpContext.Current.Cache.Get(cachedConfigKey) as SqlReportConfig;
            if (reportConfig == null)
            {
                reportConfig = new SqlReportConfig {ReportTemplateRoot = HttpContext.Server.MapPath("../sql") + "\\"};
                System.Web.HttpContext.Current.Cache.Insert(cachedConfigKey, reportConfig);
            }

            return reportConfig;
        }