Example #1
0
        }         // AdjustUIFiltersForReport

        protected void btnShowReport_Click(object sender, EventArgs e)
        {
            bool isDaily;

            ReportQuery rptDef = CreateReportQuery(out isDaily);

            var oColumnTypes = new List <string>();

            Log.Debug("Show report clicked for report: '{0}'", ddlReportTypes.SelectedItem.Text);

            bool isError;
            ATag data = reportHandler.GetReportData(ddlReportTypes.SelectedItem.Text, rptDef, isDaily, oColumnTypes, out isError);

            if (isError)
            {
                ResetBtn_Click(sender, e);
            }

            var aoColumnDefs = oColumnTypes.Select(
                sType => string.Format("{{ \"sType\": \"{0}\" }}", sType)
                ).ToList();

            divReportColumnTypes.Controls.Add(new LiteralControl(
                                                  "[" + string.Join(", ", aoColumnDefs) + "]"
                                                  ));

            var reportData = new LiteralControl(data.ToString());

            divReportData.Controls.Add(reportData);
        }         // btnShowReport_Click
Example #2
0
        public ContentResult GetReportDates(int reportId, DateTime from, DateTime to, string customer, bool?nonCash)
        {
            var report = GetReport(reportId);

            from = DateTime.SpecifyKind(from, DateTimeKind.Utc);
            to   = DateTime.SpecifyKind(to, DateTimeKind.Utc);
            var         rptDef        = new ReportQuery(report, from, to, customer, nonCash);
            var         oColumnTypes  = new List <string>();
            AConnection oDB           = DbConnectionGenerator.Get();
            var         reportHandler = new ReportHandler(oDB);
            bool        isError;

            ATag data = reportHandler.GetReportData(report, rptDef, oColumnTypes, out isError);

            return(new ContentResult {
                Content = Newtonsoft.Json.JsonConvert.SerializeObject(new {
                    report = data.ToString(),
                    columns = oColumnTypes,
                }),
                ContentType = "application/json",
            });
        }         // GetReportDates