Reports for WinForms | ComponentOne
C1.C1Report.4 Assembly / C1.C1Report Namespace / Layout Class / OverlayReplacements Property
Example

In This Topic
    OverlayReplacements Property
    In This Topic
    Gets a dictionary (System.Collections.IDictionary) with replacements to be made in the report body.
    Syntax
    'Declaration
     
    Public ReadOnly Property OverlayReplacements As IDictionary
    public IDictionary OverlayReplacements {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.

    Example
    The code below 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 : ExportFilter
    {
      // ...
      override public void EndReport()
      {
        // close output stream
        Layout layout = _ownerReport.GetLayout();
        ReplaceInStream(_exportStream, layout.OverlayReplacements);
        _exportStream.Close();
      }
    }
    See Also