public string GetReportData(int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay, string nodeId, string appId, //string segmentId, string schemeId, string strategy) { var startDate = new DateTime(startYear, startMonth, startDay); var endDate = new DateTime(endYear, endMonth, endDay); string cultureName = null; if (HttpContext != null && HttpContext.Request != null && HttpContext.Request.UserLanguages != null && HttpContext.Request.UserLanguages.Length > 0) { cultureName = HttpContext.Request.UserLanguages[0]; } //var htmlReport = Convert.ToString(ReportingModel.GetReportDataModel(startDate, endDate, nodeId, appId, schemeId, cultureName, strategy)); var htmlReport = Convert.ToString(ReportingModel.GetReportDataModel(startDate, endDate, nodeId, appId, cultureName, strategy)); return(htmlReport); }
public PartialViewResult ViewReport(NodeDTO node) { string cultureName = null; if (HttpContext != null && HttpContext.Request != null && HttpContext.Request.UserLanguages != null && HttpContext.Request.UserLanguages.Length > 0) { cultureName = HttpContext.Request.UserLanguages[0]; } var model = ReportingModel.GetReportViewModel(); return(PartialView(model)); }
public ReportingWidget(IReactivePublisher publisher , ReportingModel genericGridViewerMode) : base(publisher) { this.ViewModel = genericGridViewerMode; this.ViewModel.ParentWidget = this; this.Parameters = new ReportingParameters(); this.pluginParameters = new ReportingParameters(); this.Parameters.SetParams(this.pluginParameters.GetParams()); this.ViewModel.Parameters = (ReportingParameters)this.Parameters; GenericWindow = new ReportingVisual(this.ViewModel); this.UiElement = GenericWindow; this.publisher = publisher; }
public ReportingModel ReturnChildStatus(string AgencyID) { ReportingModel _ReportingM = new ReportingModel(); command.Parameters.Clear(); command.Parameters.Add(new SqlParameter("@AgencyID", AgencyID)); command.Parameters.Add(new SqlParameter("@ReportType", 1)); command.Connection = Connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "[ChildDataReport]"; DataAdapter = new SqlDataAdapter(command); _dataset = new DataSet(); DataAdapter.Fill(_dataset); DataTable dt = _dataset.Tables[0]; List <ReportingModel> chList = new List <ReportingModel>(); foreach (DataRow dr in _dataset.Tables[0].Rows) { chList.Add(new ReportingModel { Firstname = Convert.ToString(dr["Firstname"]), Lastname = Convert.ToString(dr["Lastname"]), DOB = Convert.ToString(dr["DOB"]), Status = Convert.ToString(dr["Status"]), CenterName = Convert.ToString(dr["CenterName"]), ClassroomName = Convert.ToString(dr["ClassroomName"]), Address = Convert.ToString(dr["Address"]), Phone = Convert.ToString(dr["Phone"]), Email = Convert.ToString(dr["EMailID"]), Guardian = Convert.ToString(dr["Guardian"]), ProgramType = Convert.ToString(dr["programType"]), DaysEnrolled = Convert.ToString(dr["DaysEnrolled"]), }); } _ReportingM.reporttype = 1; _ReportingM.ColumnName = "Enrollment Status"; _ReportingM.Reportlst = chList; Connection.Close(); command.Dispose(); return(_ReportingM); }
// GET: Reporting public ActionResult Index() { var factory = new ReportingFactory(); var repo = new ReportingRepository(); // Map the Exception Reason names from the cplx EF class to the ExceptionReasonNamesModel var data = repo .GetReportNames() .ToList() .Select(x => factory.Create(x)); var model = new ReportingModel(); // Put the list of Exception Reasons in the List for the drop down. model.ReportListNames.AddRange(data); try { ReportViewer reportViewer = new ReportViewer(); ServerReport serverReport = reportViewer.ServerReport; reportViewer.ProcessingMode = ProcessingMode.Remote; // Set the report server URL and report path //reportViewer.ServerReport.ReportServerUrl = new Uri ("http://localhost/ReportServer/"); serverReport.ReportServerUrl = new Uri("http://mlk-ssr-d-sq01/Reports/"); //reportViewer.ServerReport.ReportPath = "/AdventureWorks 2012/Sales_by_Region"; serverReport.ReportPath = "Call+Compliance%2fODS+Status"; serverReport.Refresh(); //reportViewer.ServerReport.ReportPath = // "http://mlk-ssr-d-sq01/Reports/Pages/Report.aspx?ItemPath=%2fCall+Compliance%2fODS+Status"; //reportViewer.ServerReport.ReportServerUrl = new Uri("http://reporting-dev.ultimatemedical.edu/"); ViewBag.ReportViewer = reportViewer; } catch (Exception ex) { } return(View(model)); }
public ReportingModel ReturnChildList(string AgencyID) { ReportingModel _ReportingM = new ReportingModel(); command.Parameters.Clear(); command.Parameters.Add(new SqlParameter("@AgencyID", AgencyID)); command.Parameters.Add(new SqlParameter("@ReportType", 1)); command.Connection = Connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "[ChildDataReport]"; DataAdapter = new SqlDataAdapter(command); _dataset = new DataSet(); DataAdapter.Fill(_dataset); DataTable dt = _dataset.Tables[0]; List <ReportingModel> chList = new List <ReportingModel>(); foreach (DataRow dr in _dataset.Tables[0].Rows) { chList.Add(new ReportingModel { Firstname = Convert.ToString(dr["Firstname"]), Lastname = Convert.ToString(dr["Lastname"]), DOB = Convert.ToString(dr["DOB"]), Status = Convert.ToString(dr["Status"]), ProgramType = Convert.ToString(dr["programType"]), }); } _ReportingM.reporttype = 1; _ReportingM.Reportlst = chList; Connection.Close(); command.Dispose(); return(_ReportingM); }
public ExportReportToCsvCommand(ReportingModel model) { this.model = model; }
public PartialViewResult ViewTrends(int id) { var model = ReportingModel.GetTrendsPackageData(id); return(PartialView("~/Views/Reporting/ViewTrends.cshtml", model)); }
public PartialViewResult ViewTrends(string id) { var model = ReportingModel.GetTrendsApplicationData(id); return(PartialView("~/Views/Reporting/ViewTrends.cshtml", model)); }
public JsonResult GetTrendsModel(int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay, string ID, NodeType nodeType) { var model = ReportingModel.RefreshTrends(startYear, startMonth, startDay, endYear, endMonth, endDay, ID, nodeType); return(Json(model.TrendSeries)); }
public JsonResult GetTrendsData(int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay, string ID, NodeType nodeType) { var model = ReportingModel.RefreshTrends(startYear, startMonth, startDay, endYear, endMonth, endDay, ID, nodeType); return(Json(model.TrendSeries, JsonRequestBehavior.AllowGet)); }
public JsonResult GetStrategies(string applicationId) { var model = ReportingModel.GetStrategies(applicationId); return(Json(model.Strategies, JsonRequestBehavior.AllowGet)); }
public JsonResult GetUserAccountApplicationFeatures() { var model = ReportingModel.GetUserAccountApplicationFeatures(); return(Json(model.ApplicationList, JsonRequestBehavior.AllowGet)); }
public ReportingModel ExportData(int exporttype, string AgencyID) { command.Parameters.Clear(); command.Parameters.Add(new SqlParameter("@AgencyID", AgencyID)); command.Parameters.Add(new SqlParameter("@ReportType", exporttype)); command.Connection = Connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = "[ChildDataReport]"; SqlDataAdapter DataAdapter1 = null; DataAdapter1 = new SqlDataAdapter(command); DataSet _dataset1 = null; _dataset1 = new DataSet(); DataAdapter1.Fill(_dataset1); string FileName = "attachment; filename = EnrollmentStatusReport.xlsx"; if (exporttype == 2) { FileName = "attachment; filename = EnrollmentInsuranceReport.xlsx"; } if (exporttype == 3) { FileName = "attachment; filename = EnrollmentRaceReport.xlsx"; } if (exporttype == 4) { FileName = "attachment; filename = EnrollmentEthnicityReport.xlsx"; } if (exporttype == 5) { FileName = "attachment; filename = EnrollmentGenderReport.xlsx"; } if (exporttype == 6) { FileName = "attachment; filename = EnrollmentAgeReport.xlsx"; } if (exporttype == 7) { FileName = "attachment; filename = EnrollmentLanguageReport.xlsx"; } using (XLWorkbook wb = new XLWorkbook()) { wb.Worksheets.Add(_dataset1); wb.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; wb.Style.Font.Bold = true; System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.Buffer = true; // System.Web.HttpContext.Current.Response.Charset = ""; System.Web.HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; System.Web.HttpContext.Current.Response.AddHeader("content-disposition", FileName); using (MemoryStream MyMemoryStream = new MemoryStream()) { wb.SaveAs(MyMemoryStream); MyMemoryStream.WriteTo(System.Web.HttpContext.Current.Response.OutputStream); System.Web.HttpContext.Current.Response.Flush(); System.Web.HttpContext.Current.Response.End(); } } ReportingModel _ReportingM = new ReportingModel(); return(_ReportingM); }
/// <summary> /// Initialize new instance of ReportingViewModel class. /// </summary> /// <param name="logger">Logging for the MapWizard</param> /// <param name="dialogService">Service for using project's dialogs and notifications</param> /// <param name="settingsService">Service for using and editing project's settings</param> public ReportingViewModel(ILogger logger, IDialogService dialogService, ISettingsService settingsService) { this.logger = logger; this.dialogService = dialogService; this.settingsService = settingsService; viewModelLocator = new ViewModelLocator(); RunToolCommand = new RelayCommand(RunTool, CanRunTool); GoToTractReportCommand = new RelayCommand(GoToTractReport, CanChangeView); GoToReportSelectionCommand = new RelayCommand(GoToReportSelection, CanChangeView); CheckTractFilesCommand = new RelayCommand(CheckFiles, CanRunTool); FindTractsCommand = new RelayCommand(FindTractIDs, CanRunTool); SelectTractImageFileCommand = new RelayCommand(SelectTractImageFile, CanRunTool); SelectKnownDepositsFileCommand = new RelayCommand(SelectKnownDepositsFile, CanRunTool); SelectProspectsOccurencesFileCommand = new RelayCommand(SelectProspectsOccurencesFile, CanRunTool); SelectExplorationFileCommand = new RelayCommand(SelectExplorationFile, CanRunTool); SelectSourcesFileCommand = new RelayCommand(SelectSourcesFile, CanRunTool); SelectReferencesFileCommand = new RelayCommand(SelectReferencesFile, CanRunTool); ReportingInputParams inputParams = new ReportingInputParams(); string outputFolder = Path.Combine(settingsService.RootPath, "Reporting"); if (!Directory.Exists(outputFolder)) { Directory.CreateDirectory(outputFolder); } string param_json = Path.Combine(outputFolder, "tract_report_input_params.json"); if (File.Exists(param_json)) { try { inputParams.Load(param_json); Model = new ReportingModel { TractImageFile = inputParams.TractImageFile, KnownDepositsFile = inputParams.KnownDepositsFile, ProspectsOccurencesFile = inputParams.ProspectsOccurencesFile, ExplorationFile = inputParams.ExplorationFile, SourcesFile = inputParams.SourcesFile, ReferencesFile = inputParams.ReferencesFile, SelectedTract = inputParams.SelectedTract, Authors = inputParams.Authors, Country = inputParams.Country, DescModelPath = inputParams.DescModel, DescModelName = inputParams.DescModelName, GTModelPath = inputParams.GTModel, GTModelName = inputParams.GTModelName, AddDescriptive = Convert.ToBoolean(inputParams.AddDescriptive), AddGradeTon = Convert.ToBoolean(inputParams.AddGradeTon), EnableDescCheck = Convert.ToBoolean(inputParams.EnableDescCheck), EnableGTCheck = Convert.ToBoolean(inputParams.EnableGTCheck), AsDate = inputParams.AsDate, AsDepth = inputParams.AsDepth, AsLeader = inputParams.AsLeader, AsTeamMembers = inputParams.AsTeamMembers, IsRaefDone = inputParams.IsRaefDone, IsScreenerDone = inputParams.IsScreenerDone, IsUndiscDepDone = inputParams.IsUndiscDepDone }; FindTractIDs(); // Gets the tractID names from PermissiveTractTool's Tracts folder. CheckFiles(); // Check which of the needed files for creating a report exist. if (Model.SelectedTract != null) // Check if the tool have ever been correctly ran before. { //Model.RunStatus = 0; Remove this? string docOutputFile = Path.Combine(outputFolder, Model.SelectedTract, "TractReport" + Model.SelectedTract + ".docx"); if (File.Exists(docOutputFile))// If reporting file exist then the tool have been ran. { Model.RunStatus = 1; } } SaveInputs(); // Save inputs to tract_report_input_params.json file. This might be not needed(?). } catch (Exception ex) { // If something goes wrong then the tool will be initialized to have default parameters. Model = new ReportingModel(); logger.Error(ex, "Failed to read json file"); dialogService.ShowNotification("Couldn't load Reporting tool's inputs correctly. Inputs were initialized to default values.", "Error"); viewModelLocator.SettingsViewModel.WriteLogText("Couldn't load Reporting tool's inputs correctly. Inputs were initialized to default values.", "Error"); } } else { Model = new ReportingModel(); FindTractIDs(); // Gets the tractID names from PermissiveTractTool's Trats folder. } // Check if the DepositType have been given correctly for the project. if (settingsService.Data.DepositType != null) { Model.DepositType = settingsService.Data.DepositType; } var lastRunFile = Path.Combine(settingsService.RootPath, "Reporting", "tract_report_last_run.lastrun"); if (File.Exists(lastRunFile)) { Model.LastRunDate = "Last Run: " + (new FileInfo(lastRunFile)).LastWriteTime.ToString(); } }
public ReportingSettingsViewModel(ReportingModel genericGridViewerModel, ReportingVisual genericGridViewerVisual) { this._genericGridViewerModel = genericGridViewerModel; this._genericGridViewerVisual = genericGridViewerVisual; }