Beispiel #1
0
        public static IReportAnnotation CreateReportAnnotation(XmlNode annotationNode)
        {
            CreateReportAnnotationDelegate @delegate = DependencyFactory.GetDelegate <CreateReportAnnotationDelegate>();

            if (@delegate != null)
            {
                return(@delegate(annotationNode));
            }
            return(ReportAnnotation.Load(annotationNode));
        }
        public static IReportAnnotation Load(XmlNode annotationNode)
        {
            ReportAnnotation reportAnnotation = new ReportAnnotation();

            reportAnnotation.reportTitle = ReportAnnotation.GetStringInfo(ReportingSchema.SelectSingleNode(annotationNode, "ReportTitle"));
            ReportingSchema.CheckCondition(reportAnnotation.reportTitle != null && !string.IsNullOrEmpty(reportAnnotation.reportTitle.StringId), "Report title isn't present.");
            reportAnnotation.xaxises = ReportAnnotation.LoadSeries(annotationNode, "XAxis");
            reportAnnotation.yaxises = ReportAnnotation.LoadSeries(annotationNode, "YAxis");
            ReportingSchema.CheckCondition(reportAnnotation.yaxises != null && reportAnnotation.yaxises.Count > 0, "Report Y-Axis doesn't present.");
            return(reportAnnotation);
        }
        private static List <ReportAnnotation.StringInfo> LoadSeries(XmlNode parentNode, string xpath)
        {
            List <ReportAnnotation.StringInfo> list = new List <ReportAnnotation.StringInfo>();

            using (XmlNodeList xmlNodeList = parentNode.SelectNodes(xpath))
            {
                foreach (object obj in xmlNodeList)
                {
                    XmlNode node = (XmlNode)obj;
                    list.Add(ReportAnnotation.GetStringInfo(node));
                }
            }
            return(list);
        }