protected void Page_Load(object sender, EventArgs e) { int reportId = Convert.ToInt32(Request.Form["reportId"]); string reportName = Request.Form["reportName"]; string reportDescription = Request.Form["reportDescription"]; bool includeSubTotal = Convert.ToBoolean(Request.Form["includeSubTotal"]); bool showUniqueRecords = Convert.ToBoolean(Request.Form["showUniqueRecords"]); bool aggregateReport = Convert.ToBoolean(Request.Form["aggregateReport"]); bool showDataWithGraph = Convert.ToBoolean(Request.Form["showDataWithGraph"]); string reportSql = Request.Form["reportSql"]; string connectKey = Request.Form["connectKey"]; string reportFilter = Request.Form["reportFilter"]; string reportType = Request.Form["reportType"]; int selectedFolder = Convert.ToInt32(Request.Form["selectedFolder"]); Model = new DotNetReportModel { ReportId = reportId, ReportType = reportType, ReportName = HttpUtility.UrlDecode(reportName), ReportDescription = HttpUtility.UrlDecode(reportDescription), ReportSql = reportSql, ConnectKey = connectKey, IncludeSubTotals = includeSubTotal, ShowUniqueRecords = showUniqueRecords, ShowDataWithGraph = showDataWithGraph, SelectedFolder = selectedFolder, ReportFilter = HttpUtility.UrlDecode(reportFilter) // json data to setup filter correctly again }; }
public async Task <ActionResult> ReportLink(int reportId, int?filterId = null, string filterValue = "", bool adminMode = false) { var model = new DotNetReportModel(); var settings = GetSettings(); using (var client = new HttpClient()) { var content = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("account", settings.AccountApiToken), new KeyValuePair <string, string>("dataConnect", settings.DataConnectApiToken), new KeyValuePair <string, string>("clientId", settings.ClientId), new KeyValuePair <string, string>("userId", settings.UserId), new KeyValuePair <string, string>("userRole", String.Join(",", settings.CurrentUserRole)), new KeyValuePair <string, string>("reportId", reportId.ToString()), new KeyValuePair <string, string>("filterId", filterId.HasValue ? filterId.ToString() : ""), new KeyValuePair <string, string>("filterValue", filterValue.ToString()), new KeyValuePair <string, string>("adminMode", adminMode.ToString()), new KeyValuePair <string, string>("dataFilters", (new JavaScriptSerializer()).Serialize(settings.DataFilters)) }); var response = await client.PostAsync(new Uri(settings.ApiUrl + $"/ReportApi/RunLinkedReport"), content); var stringContent = await response.Content.ReadAsStringAsync(); model = (new JavaScriptSerializer()).Deserialize <DotNetReportModel>(stringContent); } return(View("Report", model)); }
public ActionResult ReportPrint(int reportId, string reportName, string reportDescription, string reportSql, string connectKey, string reportFilter, string reportType, int selectedFolder = 0, bool includeSubTotal = true, bool showUniqueRecords = false, bool aggregateReport = false, bool showDataWithGraph = true, string userId = null, string clientId = null, string currentUserRole = null, string dataFilters = "", string reportSeries = "", bool expandAll = false) { TempData["reportPrint"] = "true"; TempData["userId"] = userId; TempData["clientId"] = clientId; TempData["currentUserRole"] = currentUserRole; TempData["dataFilters"] = dataFilters; var model = new DotNetReportModel { ReportId = reportId, ReportType = reportType, ReportName = HttpUtility.UrlDecode(reportName), ReportDescription = HttpUtility.UrlDecode(reportDescription), ReportSql = reportSql, ConnectKey = connectKey, IncludeSubTotals = includeSubTotal, ShowUniqueRecords = showUniqueRecords, ShowDataWithGraph = showDataWithGraph, SelectedFolder = selectedFolder, ReportFilter = reportFilter, // json data to setup filter correctly again ExpandAll = expandAll }; return(View(model)); }
public IActionResult Report(int reportId, string reportName, string reportDescription, bool includeSubTotal, bool showUniqueRecords, bool aggregateReport, bool showDataWithGraph, string reportSql, string connectKey, string reportFilter, string reportType, int selectedFolder) { var model = new DotNetReportModel { ReportId = reportId, ReportType = reportType, ReportName = HttpUtility.UrlDecode(reportName), ReportDescription = HttpUtility.UrlDecode(reportDescription), ReportSql = reportSql, ConnectKey = connectKey, IncludeSubTotals = includeSubTotal, ShowUniqueRecords = showUniqueRecords, ShowDataWithGraph = showDataWithGraph, SelectedFolder = selectedFolder, ReportFilter = reportFilter // json data to setup filter correctly again }; return(View(model)); }
public ActionResult Report(int reportId, string reportName, string reportDescription, bool includeSubTotal, bool showUniqueRecords, bool aggregateReport, bool showDataWithGraph, string reportSql, string connectKey, string reportFilter, string reportType, int selectedFolder, string reportSeries) { var settings = GetSettings(); var model = new DotNetReportModel { ReportId = reportId, ReportType = reportType, ReportName = HttpUtility.UrlDecode(reportName), ReportDescription = HttpUtility.UrlDecode(reportDescription), ReportSql = reportSql, ConnectKey = connectKey, IncludeSubTotals = includeSubTotal, ShowUniqueRecords = showUniqueRecords, ShowDataWithGraph = showDataWithGraph, SelectedFolder = selectedFolder, ReportSeries = !string.IsNullOrEmpty(reportSeries) ? reportSeries.Replace("%20", " ") : string.Empty, ReportFilter = reportFilter // json data to setup filter correctly again }; return(View(model)); }