//public ReportWindow () //{ // InitializeComponent(); //} public ReportWindow(EnumHelper.WMIReportCategory inputCategory) { InitializeComponent(); this.ReportCategory = inputCategory; this.Text = inputCategory.ToString() + " Reports"; }
//String DomainName = String.Empty; // String ServerName = String.Empty; //public String ReportGuid = ; public ReportWindow(EnumHelper.WMIReportCategory inputCategory, EnumHelper.Mode Mode = EnumHelper.Mode.Collection) { InitializeComponent(); this.ReportCategory = inputCategory; this.ReportMode = Mode; this.Text = inputCategory.ToString() + " Reports"; }
public Boolean InitManager(EnumHelper.WMIReportCategory reportCategory) { Boolean result = false; try { this.ReportCategory = reportCategory; ReportObject = new AMT.Manager.ReportManagers.InitializeWMICollection(); GetTaskDetails(taskName); result = ReportObject.CollectReport(wmiMachineInfo); ExportInfo exportInfo = new ExportInfo() { ReportDetails = new ReportInfo() { ExportFormat = EnumHelper.ExportFormat.HTML.ToString(), ReportName = ReportCategory.ToString(), GeneratorName = "Adminstrator", ProductName = "AMT", ReportDate = DateTime.Now.ToString(), ExportPath = Path.Combine(@"C:\Users\Public\Documents\AMT\Preview") }, MachineInfo = wmiMachineInfo }; exportInfo.ReportDetails.ExportPath = System.IO.Path.Combine(exportInfo.ReportDetails.ExportPath, Utility.GetTimeStamp()); if (!System.IO.Directory.Exists(exportInfo.ReportDetails.ExportPath)) { System.IO.Directory.CreateDirectory(exportInfo.ReportDetails.ExportPath); } ReportObject.ExportReportData(exportInfo); } catch (Exception) { throw; } return(result); }
public EnumHelper.WMIReportCategory GetReportCategoryFromName(String Name) { EnumHelper.WMIReportCategory reportCategroy = 0; try { string[] names = Enum.GetNames(typeof(EnumHelper.WMIReportCategory)); EnumHelper.WMIReportCategory[] values = (EnumHelper.WMIReportCategory[])Enum.GetValues(typeof(EnumHelper.WMIReportCategory)); for (int i = 0; i < names.Length; i++) { if (names[i].ToString() == Name) { reportCategroy = values[i]; } // print(names[i], values[i]); } } catch (Exception ex) { AMTLogger.WriteToLog(ex.Message, MethodBase.GetCurrentMethod().Name, 0, AMTLogger.LogInfo.Error); } return(reportCategroy); }