コード例 #1
0
        public ReportViewPage(ReportMetaData reportMetaData)
        {
            _reportService = new ReportService();

            _reportMetaData = reportMetaData;
            InitializeComponent();
        }
コード例 #2
0
        private static ReportMetaData Merge(ReportMetaData primary, ReportMetaData secondary)
        {
            var mergedReportDetails = new ReportDetails
            {
                Title               = primary.ReportDetails.Title ?? secondary.ReportDetails.Title,
                Description         = primary.ReportDetails.Description ?? secondary.ReportDetails.Description,
                ContainsPhi         = primary.ReportDetails.ContainsPhi,
                Tags                = primary.ReportDetails.Tags ?? secondary.ReportDetails.Tags,
                Parameters          = primary.ReportDetails.Parameters ?? secondary.ReportDetails.Parameters,
                VisualContext       = primary.ReportDetails.VisualContext,
                FolderPath          = primary.ReportDetails.FolderPath,
                CanExport           = primary.ReportDetails.CanExport,
                RenderingAttributes = primary.ReportDetails.RenderingAttributes ?? secondary.ReportDetails.RenderingAttributes
            };

            var mergedRmd = new ReportMetaData
            {
                ParentReportMetaDataId = primary.ParentReportMetaDataId ?? secondary.ParentReportMetaDataId,
                ExternalReportKey      = primary.ExternalReportKey ?? secondary.ExternalReportKey,
                ReportDetails          = mergedReportDetails,
                OwnerContactId         = primary.OwnerContactId ?? secondary.OwnerContactId,
                TenantId = primary.TenantId
            };

            return(mergedRmd);
        }
コード例 #3
0
 /// <summary>
 /// Retrieve a ReportDTOModel
 /// <para>Returns ReportDTOModel</para>
 /// </summary>
 /// <returns>ReportDTOModel</returns>
 public ReportDTOModel GetReport(ReportDTOModel reportDTOModel)
 {
     using IDatabase db = Conn();
     try
     {
         try
         {
             ReportMetaData reportMetaData = db.Single <ReportMetaData>("exec rpt.GetReportMetaData @ReportID",
                                                                        new
             {
                 ReportID = int.Parse(reportDTOModel.ReportDefID)
             });
             reportDTOModel.ReportMetaData = reportMetaData;
             return(reportDTOModel);
         }
         catch (Exception e)
         {
             LogCritical("|" + MethodBase.GetCurrentMethod() + "|" + e.Message);
             throw new Exception(e.Message);
         }
     }
     catch (Exception e)
     {
         LogCritical("|" + MethodBase.GetCurrentMethod() + "|" + e.Message);
         throw new Exception(e.Message);
     }
 }
コード例 #4
0
 public SelectOutputFields()
 {
     _report          = null;
     _availableFields = new BindingList <FieldMetaData>();
     _selectedFields  = new BindingList <FieldMetaData>();
     InitializeComponent();
 }
コード例 #5
0
        private async Task <List <ReportMetaData> > GetReportMetaDataAsync(string viewName)
        {
            using (_logger.BeginScope("----- GetReportMetaDataAsync -----"))
            {
                try
                {
                    var ret = new List <ReportMetaData>();

                    await _dataAccess.ExecuteCommandAsync(x =>
                    {
                        var reader = x.ExecuteReader(Query.GET_DB_OBJECT_METADATA, new { objectName = viewName });

                        while (reader.Read())
                        {
                            var metaData = new ReportMetaData(reader["COLUMN_NAME"] as string, reader["DATA_TYPE"] as string);
                            ret.Add(metaData);
                        }
                    });

                    return(ret);
                }
                catch (Exception ex)
                {
                    _logger.LogError(ex.Message);
                    throw ex;
                }
            }
        }
コード例 #6
0
 protected override void OnDisplay(bool firstDisplay)
 {
     if (_report != ReportWizardState.SelectedMasterReport)
     {
         _report = ReportWizardState.SelectedMasterReport;
         LoadFields();
     }
 }
コード例 #7
0
        public ReportDTOModel GetReport(ReportDTOModel reportDTOModel)
        {
            switch (reportDTOModel.ReportDefID)
            {
            case "1":

                ReportMetaData report = new ReportMetaData()
                {
                    ReportTitle    = "Full UVIMCO Portfolio Review - Performance",
                    ReportHeader   = "",
                    ReportFootNote = "",
                    URL            = "PartialReport",
                    RenderNatively = true,
                };

                reportDTOModel.ReportMetaData = report;
                break;

            case "2":
                reportDTOModel.ReportMetaData = new ReportMetaData
                {
                    URL            = "https://gallery.shinyapps.io/lego-viz/",
                    RenderNatively = false
                };
                break;

            case "3":
                reportDTOModel.ReportMetaData = new ReportMetaData
                {
                    URL            = "https://shiny.uvimco.org/shinyRTDA/",
                    RenderNatively = false
                };
                break;

            case "4":
                reportDTOModel.ReportMetaData = new ReportMetaData
                {
                    URL            = "https://gallery.shinyapps.io/050-kmeans-example",
                    RenderNatively = false
                };
                break;

            case "5":
                reportDTOModel.ReportMetaData = new ReportMetaData
                {
                    URL            = "https://gallery.shinyapps.io/lego-viz/",
                    RenderNatively = false
                };
                break;
            }
            return(reportDTOModel);
        }
コード例 #8
0
 protected override void OnDisplay(bool firstDisplay)
 {
     if (firstDisplay)
     {
         SetupDataBinding();
     }
     if (_selectedReport != ReportWizardState.SelectedMasterReport)
     {
         _selectedReport           = ReportWizardState.SelectedMasterReport;
         isLastGroupDetail.Checked = false;
         LoadAvailableFields();
     }
 }
コード例 #9
0
ファイル: Program.cs プロジェクト: vahmax/Samples14
        private static ReportMetaData LoadReportMetaData(XmlNode node)
        {
            ReportMetaData data = new ReportMetaData();

            data.Title            = node.Attributes["title"].Value;
            data.MasterReportFile = node.Attributes["filename"].Value;
            XmlNodeList fields = node.SelectNodes("fields/field");

            foreach (XmlNode fieldNode in fields)
            {
                FieldMetaData field = LoadFieldMetaData(fieldNode);
                data.Fields.Add(field.Name, field);
            }
            return(data);
        }
コード例 #10
0
ファイル: Helper.cs プロジェクト: soleverxu/ADM-TFS-Extension
        public static List <ReportMetaData> readReportFromXMLFile(string reportPath)
        {
            List <ReportMetaData> listReport = new List <ReportMetaData>();
            XmlDocument           xmlDoc     = new XmlDocument();

            xmlDoc.Load(reportPath);

            foreach (XmlNode node in xmlDoc.DocumentElement.ChildNodes)
            {
                foreach (XmlNode currentNode in node)
                {
                    ReportMetaData         reportmetadata = new ReportMetaData();
                    XmlAttributeCollection attributesList = currentNode.Attributes;
                    foreach (XmlAttribute attribute in attributesList)
                    {
                        switch (attribute.Name)
                        {
                        case "name": reportmetadata.setDisplayName(attribute.Value); break;

                        case "status": reportmetadata.setStatus(attribute.Value); break;

                        default: break;
                        }
                    }

                    XmlNodeList nodes = currentNode.ChildNodes;
                    foreach (XmlNode xmlNode in nodes)
                    {
                        if (xmlNode.Name.Equals("system-out"))
                        {
                            reportmetadata.setDateTime(xmlNode.InnerText.Substring(0, 19));
                        }
                    }
                    listReport.Add(reportmetadata);
                }
            }

            return(listReport);
        }
コード例 #11
0
        private static IReportVisual Merge(ITableauReportVisual tableauReportVisual, ReportMetaData reportMetaData)
        {
            Requires.NonNull(reportMetaData.ReportDetails.Description, nameof(reportMetaData.ReportDetails.Description));

            const string siteIdKey = "SiteId";

            var metadataWorkbookName = reportMetaData.ReportDetails.Parameters?.SingleOrDefault(x => x.Key == nameof(tableauReportVisual.WorkbookName)).Value ?? tableauReportVisual.WorkbookName;
            var metadataWorkbookId   =
                reportMetaData.ReportDetails.Parameters?.SingleOrDefault(
                    x => x.Key == nameof(tableauReportVisual.WorkbookId)).Value ?? tableauReportVisual.WorkbookId;
            var metadataViewId =
                reportMetaData.ReportDetails.Parameters?.SingleOrDefault(x => x.Key == nameof(tableauReportVisual.Id))
                .Value ?? tableauReportVisual.Id;
            var metadataViewName =
                reportMetaData.ReportDetails.Parameters?.SingleOrDefault(
                    x => x.Key == nameof(tableauReportVisual.ViewName)).Value ?? tableauReportVisual.ViewName;
            var metadataWorksheetName =
                reportMetaData.ReportDetails.Parameters?.SingleOrDefault(
                    x => x.Key == nameof(tableauReportVisual.WorksheetName)).Value;


            var workbookName  = new KeyValuePair <string, string>(nameof(tableauReportVisual.WorkbookName), metadataWorkbookName);
            var workbookId    = new KeyValuePair <string, string>(nameof(tableauReportVisual.WorkbookId), metadataWorkbookId);
            var viewId        = new KeyValuePair <string, string>(nameof(tableauReportVisual.Id), metadataViewId);
            var viewName      = new KeyValuePair <string, string>(nameof(tableauReportVisual.ViewName), metadataViewName);
            var worksheetName = new KeyValuePair <string, string>(nameof(tableauReportVisual.WorksheetName), metadataWorksheetName);
            var siteId        = new KeyValuePair <string, string>(siteIdKey, reportMetaData.TenantId.ToString());
            var parameters    = new Collection <KeyValuePair <string, string> >
            {
                workbookName,
                workbookId,
                viewId,
                viewName,
                siteId,
                worksheetName
            };

            var visual = new ReportVisual();

            ((IReportVisual)visual).CanExport         = reportMetaData.ReportDetails.CanExport;
            ((IReportVisual)visual).ContainsPhi       = reportMetaData.ReportDetails.ContainsPhi;
            ((IReportVisual)visual).Description       = reportMetaData.ReportDetails.Description ?? "No description available";
            ((IReportVisual)visual).ExternalReportKey = tableauReportVisual.Id;
            ((IReportVisual)visual).Favorite          = reportMetaData.ReportDetails.Favorite;
            ((IReportVisual)visual).FolderPath        = reportMetaData.ReportDetails.FolderPath ?? "/";
            ((IReportVisual)visual).Id              = reportMetaData.ReportMetaDataId;
            ((IReportVisual)visual).LastEdit        = reportMetaData.ReportDetails.LastEdit;
            ((IReportVisual)visual).LastEditedField = reportMetaData.ReportDetails.LastEditedField;
            ((IReportVisual)visual).OwnerContactId  = reportMetaData.OwnerContactId;
            ((IReportVisual)visual).Parameters      = parameters;
            ((IReportVisual)visual).ParentId        = reportMetaData.ParentReportMetaDataId;
            ((IReportVisual)visual).PreviewImageUrl = reportMetaData.ReportDetails.PreviewImageUrl ??
                                                      $"/Reporting/PreviewImage/{tableauReportVisual.WorkbookId}/{tableauReportVisual.Id}";
            ((IReportVisual)visual).Shared              = reportMetaData.ReportDetails.Shared;
            ((IReportVisual)visual).Tags                = reportMetaData.ReportDetails.Tags;
            ((IReportVisual)visual).Title               = reportMetaData.ReportDetails.Title ?? tableauReportVisual.ViewName;
            ((IReportVisual)visual).VisualContext       = reportMetaData.ReportDetails.VisualContext;
            ((IReportVisual)visual).RenderingAttributes = reportMetaData.ReportDetails.RenderingAttributes;

            return(visual);
        }
コード例 #12
0
 public ReportMetadataViewModel(ReportMetaData reportMetadata)
 {
     ReportMetadataId = reportMetadata.ReportMetaDataId;
     Title            = reportMetadata.ReportDetails.Title;
 }
コード例 #13
0
        public static IList <ReportMetaData> ReadReportFromXMLFile(string reportPath, bool isJUnitReport, out IDictionary <string, IList <ReportMetaData> > failedSteps)
        {
            failedSteps = new Dictionary <string, IList <ReportMetaData> >();
            var         listReport = new List <ReportMetaData>();
            XmlDocument xmlDoc     = new XmlDocument();

            xmlDoc.Load(reportPath);

            foreach (XmlNode node in xmlDoc.DocumentElement.ChildNodes) //inside <testsuite> node
            {
                var    failedTestSteps = new List <ReportMetaData>();
                string testName        = string.Empty;
                if (isJUnitReport)
                {
                    string currentTest = node.Attributes[NAME].Value;
                    testName = currentTest.Substring(currentTest.LastIndexOf(DASH) + 1);
                }

                foreach (XmlNode currentNode in node) //inside <testcase> nodes
                {
                    var reportmetadata = new ReportMetaData();
                    var attributesList = currentNode.Attributes;
                    foreach (XmlAttribute attribute in attributesList)
                    {
                        switch (attribute.Name)
                        {
                        case NAME: reportmetadata.DisplayName = attribute.Value; break;

                        case REPORT: reportmetadata.ReportPath = attribute.Value; break;

                        case STATUS: reportmetadata.Status = attribute.Value; break;

                        case TIME: reportmetadata.Duration = attribute.Value; break;

                        default: break;
                        }
                    }

                    if (isJUnitReport)
                    {
                        //remove the number in front of each step
                        string stepName = reportmetadata.DisplayName;
                        if (stepName?.StartsWith(DIEZ) == true)
                        {
                            reportmetadata.DisplayName = stepName.Substring(stepName.IndexOf(COLON) + 1);
                        }
                    }

                    var nodes = currentNode.ChildNodes;
                    foreach (XmlNode xmlNode in nodes)//inside nodes in <testcase> nodes
                    {
                        if (xmlNode.Name == FAILURE)
                        {
                            foreach (XmlAttribute attribute in xmlNode.Attributes)
                            {
                                if (attribute.Name == MESSAGE)
                                {
                                    reportmetadata.ErrorMessage = attribute.Value;
                                    reportmetadata.Status       = FAIL;
                                }
                            }
                        }
                        if (xmlNode.Name == SYSTEM_OUT)
                        {
                            reportmetadata.DateTime = xmlNode.InnerText.Substring(0, 19);
                        }
                    }
                    if (isJUnitReport && reportmetadata.Status == FAIL)
                    {
                        failedTestSteps.Add(reportmetadata);
                    }
                    listReport.Add(reportmetadata);
                }
                if (isJUnitReport && failedTestSteps.Any())
                {
                    failedSteps.Add(testName, failedTestSteps);
                }
            }

            return(listReport);
        }
コード例 #14
0
        public static List <ReportMetaData> readReportFromXMLFile(string reportPath, Dictionary <string, List <ReportMetaData> > testSteps, bool isJUnitReport)
        {
            List <ReportMetaData> listReport = new List <ReportMetaData>();
            XmlDocument           xmlDoc     = new XmlDocument();

            xmlDoc.Load(reportPath);

            foreach (XmlNode node in xmlDoc.DocumentElement.ChildNodes) //inside <testsuite> node
            {
                List <ReportMetaData> steps = new List <ReportMetaData>();
                string testName             = "";
                if (isJUnitReport)
                {
                    string currentTest = node.Attributes["name"].Value;
                    testName = currentTest.Substring(currentTest.LastIndexOf("-") + 1);
                }

                foreach (XmlNode currentNode in node) //inside <testcase> nodes
                {
                    ReportMetaData         reportmetadata = new ReportMetaData();
                    XmlAttributeCollection attributesList = currentNode.Attributes;
                    foreach (XmlAttribute attribute in attributesList)
                    {
                        switch (attribute.Name)
                        {
                        case "name": reportmetadata.setDisplayName(attribute.Value); break;

                        case "report": reportmetadata.setReportPath(attribute.Value); break;

                        case "status": reportmetadata.setStatus(attribute.Value); break;

                        case "time": reportmetadata.setDuration(attribute.Value); break;

                        default: break;
                        }
                    }

                    if (isJUnitReport)
                    {
                        //remove the number in front of each step
                        string stepName = reportmetadata.getDisplayName();
                        if (!String.IsNullOrEmpty(stepName))
                        {
                            if (stepName.StartsWith("#"))
                            {
                                reportmetadata.setDisplayName(stepName.Substring(stepName.IndexOf(":") + 1));
                            }
                        }
                    }

                    XmlNodeList nodes = currentNode.ChildNodes;
                    foreach (XmlNode xmlNode in nodes)//inside nodes in <testcase> nodes
                    {
                        if (xmlNode.Name.Equals("failure"))
                        {
                            foreach (XmlAttribute attribute in xmlNode.Attributes)
                            {
                                if (attribute.Name.Equals("message"))
                                {
                                    reportmetadata.setErrorMessage(attribute.Value);
                                    reportmetadata.setStatus("fail");
                                }
                            }
                        }
                        if (xmlNode.Name.Equals("system-out"))
                        {
                            reportmetadata.setDateTime(xmlNode.InnerText.Substring(0, 19));
                        }
                    }
                    if (isJUnitReport)
                    {
                        steps.Add(reportmetadata);
                    }
                    listReport.Add(reportmetadata);
                }
                if (isJUnitReport)
                {
                    testSteps.Add(testName, steps);
                }
            }

            return(listReport);
        }
コード例 #15
0
 public void Init()
 {
     instance = new ReportMetaData();
 }