Assembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
[BrowsableAttribute(false)] public IDictionary OverlayReplacements { get; } |
Visual Basic |
---|
<BrowsableAttribute(False)> _ Public ReadOnly Property OverlayReplacements As IDictionary Get |
Remarks
This property is useful when implementing export filters.
Reports that contain page counts or group page counts save special tags in the report body. When the report finishes rendering, these tags need to be replaced with the actual page counts. Filters can get the list of tags and the replacement values using this dictionary. The key-value pairs in the dictionary contain the tags and their replacements.
Examples
The following code shows part of a text filter implementation. The EndReport method gets the overlay replacement dictionary and calls a ReplaceInStream method that scans each line in the stream and replaces any keys with the corresponding values. For example, the total page count would be represented by a key similar to "#pages#", which would be replaced everywhere in the stream with the actual page count.
Public Class MyTextFilter Inherits ExportFilter Public Overrides Sub EndReport() ' close output stream Dim layout As Layout = _ownerReport.GetLayout() ReplaceInStream(_exportStream, layout.OverlayReplacements) exportStream.Close() End Sub End Class |
public class MyTextFilter : ExportFilter { override public void EndReport() { // close output stream Layout layout = _ownerReport.GetLayout(); ReplaceInStream(_exportStream, layout.OverlayReplacements); exportStream.Close(); } } |