Table of Contents

Class RdlElement

Namespace
DocWright.Reporting
Assembly
DocWright.Reporting.dll

One element of a report definition, with its attributes, its children and — for a leaf — its text. This is the whole model: a definition is a tree of these.

public sealed class RdlElement
Inheritance
RdlElement
Inherited Members

Remarks

Why the model is an element tree rather than 250 generated classes. MS-RDL declares around 250 global types across four schema versions, and a designer must be able to open a report written by Report Builder, change one textbox, and save it back without discarding anything it did not understand. A typed graph makes that a promise the implementation has to keep element by element, and it is kept imperfectly — the class that forgets one optional child silently drops it on every save, and nothing reports it. An element tree makes losslessness structural: an element nobody modelled is still an element, so it survives by default rather than by diligence. Typed accessors are a projection over this, the way Dom's content-control properties project over its underlying nodes.

Sparseness is structural too. A property is stated exactly when its element is present, so a report that writes <CanGrow>false</CanGrow> and one that omits it round-trip differently, which is what keeps a designer's save from rewriting a customer's file.

Not thread-safe: an instance is a mutable document node. Two threads may read one tree; a writer needs exclusive access, as with every other DocWright model.

Constructors

RdlElement(RdlName)

Initializes an element.

Properties

Attributes

Gets this element's attributes, in document order.

Children

Gets this element's children, in document order.

IsLeaf

Gets a value indicating whether this element has no children.

Name

Gets the element's qualified name.

Prefix

Gets or sets the prefix the source bound to this element's namespace, or null when the element was in a default namespace or none.

Value

Gets or sets this element's text, or null when it has none.

Methods

AttributeValue(string)

Gets the value of the attribute with the given local name, in any namespace.

Clone()

Creates a deep copy of this element.

DescendantsAndSelf()

Enumerates every element in this subtree, including this one, depth first in document order.

Element(string)

Finds the first child with the given local name, in any namespace.

ElementValue(string)

Gets the text of the first child with the given local name.

Elements(string)

Enumerates the children with the given local name, in document order.

StructurallyEquals(RdlElement?)

Compares two subtrees by name, attributes, order and text — ignoring the prefixes that happened to be used.