示例#1
0
 public void Validate(PublishingErrorContext errorContext)
 {
     if (this.MapSpatialData is MapSpatialDataRegion && this.MapDataRegionName == null)
     {
         errorContext.Register(ProcessingErrorCode.rsMapLayerMissingProperty, Severity.Error, base.m_map.ObjectType, base.m_map.Name, base.m_name, "MapDataRegionName");
     }
     if (!(this.MapSpatialData is MapSpatialDataRegion) && this.MapDataRegionName != null && this.MapBindingFieldPairs == null)
     {
         errorContext.Register(ProcessingErrorCode.rsMapLayerMissingProperty, Severity.Error, base.m_map.ObjectType, base.m_map.Name, base.m_name, "MapBindingFieldPairs");
     }
 }
 private bool ValidatePrerequisite(bool condition, ProcessingErrorCode errorCode, string objectName, string propertyName, params string[] arguments)
 {
     if (!condition)
     {
         m_errorContext.Register(errorCode, Severity.Error, ObjectType.ParameterLayout, objectName, propertyName, arguments);
     }
     return(condition);
 }
示例#3
0
 public void RestrictDataSetAggregates(PublishingErrorContext m_errorContext)
 {
     if (!this.m_usedOnlyInParameters && this.m_usedInAggregates && (this.m_dataRegions == null || this.m_dataRegions.Count == 0))
     {
         if (this.m_defaultRelationships != null)
         {
             m_errorContext.Register(ProcessingErrorCode.rsDefaultRelationshipIgnored, Severity.Warning, this.ObjectType, this.Name, "DefaultRelationship");
         }
         if (this.m_aggregates != null)
         {
             foreach (DataAggregateInfo aggregate in this.m_aggregates)
             {
                 if (aggregate.AggregateType != 0)
                 {
                     m_errorContext.Register(ProcessingErrorCode.rsInvalidDataSetScopedAggregate, Severity.Error, this.ObjectType, this.Name, aggregate.AggregateType.ToString());
                 }
             }
         }
     }
 }
示例#4
0
 internal void RestrictDataSetAggregates(PublishingErrorContext m_errorContext)
 {
     if (m_usedOnlyInParameters || !m_usedInAggregates || (m_dataRegions != null && m_dataRegions.Count != 0))
     {
         return;
     }
     if (m_defaultRelationships != null)
     {
         m_errorContext.Register(ProcessingErrorCode.rsDefaultRelationshipIgnored, Severity.Warning, ObjectType, Name, "DefaultRelationship");
     }
     if (m_aggregates == null)
     {
         return;
     }
     foreach (DataAggregateInfo aggregate in m_aggregates)
     {
         if (aggregate.AggregateType != 0)
         {
             m_errorContext.Register(ProcessingErrorCode.rsInvalidDataSetScopedAggregate, Severity.Error, ObjectType, Name, aggregate.AggregateType.ToString());
         }
     }
 }
        private bool RdlAdditionAttributeLocationValidation(out string message)
        {
            message = null;
            HashSet <string> hashSet = null;

            if (NodeType == XmlNodeType.Element && HasAttributes)
            {
                string expandedName = GetExpandedName(LocalName, NamespaceURI);
                string namespaceURI = NamespaceURI;
                if (string.CompareOrdinal(expandedName, GetExpandedName("Report", "http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition")) == 0 && GetAttributeLocalName("MustUnderstand") != null)
                {
                    hashSet = new HashSet <string>(GetAttributeLocalName("MustUnderstand").Split());
                }
                while (MoveToNextAttribute())
                {
                    string text = NamespaceURI;
                    if (string.IsNullOrEmpty(text))
                    {
                        text = namespaceURI;
                    }
                    if (IsMicroVersionedAttributeNamespace(text))
                    {
                        string expandedName2 = GetExpandedName(LocalName, text);
                        if (m_itemType == ItemType.Rdl || m_itemType == ItemType.Rsd)
                        {
                            message = RDLValidatingReaderStrings.rdlValidationInvalidNamespaceAttribute(expandedName2, text, base.LineNumber.ToString(CultureInfo.InvariantCulture.NumberFormat), base.LinePosition.ToString(CultureInfo.InvariantCulture.NumberFormat));
                        }
                        else
                        {
                            string[] values = m_microversioningValidationStructureAttributes.GetValues(expandedName2);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Length; i++)
                                {
                                    if (values[i].Equals(expandedName, StringComparison.Ordinal))
                                    {
                                        MoveToElement();
                                        return(true);
                                    }
                                }
                            }
                            message = RDLValidatingReaderStrings.rdlValidationInvalidMicroVersionedAttribute(expandedName2, expandedName, base.LineNumber.ToString(CultureInfo.InvariantCulture.NumberFormat), base.LinePosition.ToString(CultureInfo.InvariantCulture.NumberFormat));
                        }
                    }
                    if (hashSet != null && Prefix == "xmlns" && hashSet.Contains(LocalName))
                    {
                        hashSet.Remove(LocalName);
                        if (!m_serverSupportedSchemas.Contains(Value))
                        {
                            message = RDLValidatingReaderStrings.rdlValidationUnsupportedSchema(Value, LocalName, base.LineNumber.ToString(CultureInfo.InvariantCulture.NumberFormat), base.LinePosition.ToString(CultureInfo.InvariantCulture.NumberFormat));
                            m_errorContext.Register(ProcessingErrorCode.rsInvalidMustUnderstandNamespaces, Severity.Error, ObjectType.Report, null, "MustUnderstand", message);
                            throw new ReportProcessingException(m_errorContext.Messages);
                        }
                    }
                }
                if (hashSet != null && hashSet.Count != 0)
                {
                    if (hashSet.Count == 1)
                    {
                        message = RDLValidatingReaderStrings.rdlValidationUndefinedSchemaNamespace(hashSet.First(), "MustUnderstand", base.LineNumber.ToString(CultureInfo.InvariantCulture.NumberFormat), base.LinePosition.ToString(CultureInfo.InvariantCulture.NumberFormat));
                        m_errorContext.Register(ProcessingErrorCode.rsInvalidMustUnderstandNamespaces, Severity.Error, ObjectType.Report, null, "MustUnderstand", message);
                        throw new ReportProcessingException(m_errorContext.Messages);
                    }
                    message = RDLValidatingReaderStrings.rdlValidationMultipleUndefinedSchemaNamespaces(string.Join(", ", hashSet.ToArray()), "MustUnderstand", base.LineNumber.ToString(CultureInfo.InvariantCulture.NumberFormat), base.LinePosition.ToString(CultureInfo.InvariantCulture.NumberFormat));
                    m_errorContext.Register(ProcessingErrorCode.rsInvalidMustUnderstandNamespaces, Severity.Error, ObjectType.Report, null, "MustUnderstand", message);
                    throw new ReportProcessingException(m_errorContext.Messages);
                }
                MoveToElement();
            }
            return(message == null);
        }