Word Reports
HeaderForegroundColor Property
Example 



KellermanSoftware.WordReports Namespace > Configuration Class : HeaderForegroundColor Property
The foreground color of the header for tables. The default is White
Syntax
Public Property HeaderForegroundColor As Color
Dim instance As Configuration
Dim value As Color
 
instance.HeaderForegroundColor = value
 
value = instance.HeaderForegroundColor
public Color HeaderForegroundColor {get; set;}
public:
property Color HeaderForegroundColor {
   Color get();
   void set (    Color value);
}
Example
//To run this example code, create a word document called ExampleTemplate.docx with the text [ReplaceMe] in the document
 
WordReportsGenerator generator = new WordReportsGenerator(); //Trial Mode
//WordReportsGenerator generator = new WordReportsGenerator("place user name here", "place license key here"); //License Mode
 
const string sourceDocumentPath = @"Test Documents\ExampleTemplate.docx";
const string outputDocumentPath = "ExampleOutput.docx";
 
using (Document document = generator.DocumentFactory(sourceDocumentPath))
{
    DataTable dataTable = new DataTable();
    dataTable.Columns.Add("FirstName", typeof(string));
    dataTable.Rows.Add("John");
    Dictionary<string, ReplacementItem> replacement =
        new Dictionary<string, ReplacementItem>
            {
                {
                    "[ReplaceMe]",
                    new ReplacementItem {Value = dataTable}
                }
            };
 
    generator.Config.HeaderForegroundColor = System.Drawing.Color.Yellow;
 
    generator.Replace(document, replacement);
 
    generator.SaveDocument(document, outputDocumentPath);
}
'To run this example code, create a word document called ExampleTemplate.docx with the text [ReplaceMe] in the document
 
Dim generator As New WordReportsGenerator() 'Trial Mode
'WordReportsGenerator generator = new WordReportsGenerator("place user name here", "place license key here"); //License Mode
 
Const sourceDocumentPath As String = "Test Documents\ExampleTemplate.docx"
Const outputDocumentPath As String = "ExampleOutput.docx"
 
Using document As Document = generator.DocumentFactory(sourceDocumentPath)
    Dim dataTable As New DataTable()
    dataTable.Columns.Add("FirstName", GetType(String))
    dataTable.Rows.Add("John")
    Dim replacement As New Dictionary(Of String, ReplacementItem)() From {{ "[ReplaceMe]", New ReplacementItem With {.Value = dataTable} }}
 
    generator.Config.HeaderForegroundColor = System.Drawing.Color.Yellow
 
    generator.Replace(document, replacement)
 
    generator.SaveDocument(document, outputDocumentPath)
End Using
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Configuration Class
Configuration Members