Table of Contents

Class RdlMeasure

Namespace
DocWright.Reporting
Assembly
DocWright.Reporting.dll

Converts between RDL size strings ("2.5in", "12pt") and integer twips.

public static class RdlMeasure
Inheritance
RdlMeasure
Inherited Members

Remarks

This is the parse boundary, and it is the only place decimals are allowed in. An RDL size is a decimal string with a unit suffix; DocWright's geometry is integer twips. The conversion happens once, here, rounding half away from zero — everything downstream is integer arithmetic. Decimal rather than double on purpose: it is exact in base ten, so 0.1in converts to the same twip count on every runtime instead of to whatever the nearest binary fraction rounds to.

The schema constrains none of this. SizeType is an unconstrained normalizedString in both committed schemas, so "2,5pt", "Bolds" and "12 furlongs" all validate cleanly and none of them is a size. Parsing is therefore strict and reports what it rejects rather than guessing.

Formatting emits points, because a twip is exactly a twentieth of a point: every value lands on a multiple of 0.05pt and no rounding decision arises. The digits are assembled by hand, so CultureInfo.CurrentCulture is not merely overridden but unreachable — the failure being avoided is a comma-decimal culture emitting "2,5pt", which is schema-valid and still rejected by the report server.

Methods

Parse(string?, string, Twips, IConversionDiagnostics?)

Converts an RDL size string to twips, reporting anything it had to do to the value.

ToPoints(Twips)

Formats a measure as an RDL point size, for example "12.25pt".

TryParse(string?, out Twips)

Tries to convert an RDL size string to twips.

TryParse(string?, out Twips, out bool)

Tries to convert an RDL size string to twips, reporting whether the value had to be clamped.