Excel Reports
Configuration Property
Example 



KellermanSoftware.ExcelReports Namespace > ExcelReportsGenerator Class : Configuration Property
Global formatting configuration
Syntax
Public ReadOnly Property Configuration As Configuration
Dim instance As ExcelReportsGenerator
Dim value As Configuration
 
value = instance.Configuration
public Configuration Configuration {get;}
public:
property Configuration^ Configuration {
   Configuration^ get();
}
Example
ExcelReportsGenerator generator = new ExcelReportsGenerator(); //Trial Mode
//ExcelReportsGenerator generator = new ExcelReportsGenerator("place user name here", "place license key here"); //License Mode
 
//Create a header for the worksheet. The default is true.
generator.Configuration.CreateHeader = true;
 
//The text when a boolean is false. The default is False
generator.Configuration.FalseText = string.Empty;
 
//The text when a boolean is true. The default is True
generator.Configuration.TrueText = "Yes";
 
//The background color of the header. The default is Black
generator.Configuration.HeaderBackgroundColor = System.Drawing.Color.Blue;
 
//The foreground color of the header. The default is White
generator.Configuration.HeaderForegroundColor = System.Drawing.Color.Yellow;
 
//Insert spaces into enum values based on capitilization. The default is True
generator.Configuration.InsertSpacesIntoEnumValues = false;
 
//Insert spaces into header columns based on capitilization. The default is True
generator.Configuration.InsertSpacesIntoHeaderColumns = false;
 
//The default text when a date is DateTime.MinValue. The default is string.Empty
generator.Configuration.MinValueDateText = "1/1/1970";
 
//When there are no items in a list or data table or just the header for CSV, 
//the NoItemsMessage will show on the second row
//The default is "No items found"
generator.Configuration.NoItemsMessage = "No records";
 
//The default text when a value is null. The default is string.Empty.
generator.Configuration.NullText = "(null)";
 
string csvString = @"Name,Birthdate
John Smith,6/22/2013";
 
generator.GenerateFromCsvString(csvString,"Birthdays","ConfigurationExample.xlsx");
Dim generator As New ExcelReportsGenerator() 'Trial Mode
'Dim generator As New ExcelReportsGenerator("place user name here", "place license key here") 'License Mode
 
'Create a header for the worksheet. The default is true.
generator.Configuration.CreateHeader = True
 
'The text when a boolean is false. The default is False
generator.Configuration.FalseText = String.Empty
 
'The text when a boolean is true. The default is True
generator.Configuration.TrueText = "Yes"
 
'The background color of the header. The default is Black
generator.Configuration.HeaderBackgroundColor = System.Drawing.Color.Blue
 
'The foreground color of the header. The default is White
generator.Configuration.HeaderForegroundColor = System.Drawing.Color.Yellow
 
'Insert spaces into enum values based on capitilization. The default is True
generator.Configuration.InsertSpacesIntoEnumValues = False
 
'Insert spaces into header columns based on capitilization. The default is True
generator.Configuration.InsertSpacesIntoHeaderColumns = False
 
'The default text when a date is DateTime.MinValue. The default is string.Empty
generator.Configuration.MinValueDateText = "1/1/1970"
 
'When there are no items in a list or data table or just the header for CSV, 
'the NoItemsMessage will show on the second row
'The default is "No items found"
generator.Configuration.NoItemsMessage = "No records"
 
'The default text when a value is null. The default is string.Empty.
generator.Configuration.NullText = "(null)"
 
Dim csvString As String = "Name,Birthdate" & ControlChars.CrLf & "John Smith,6/22/2013"
 
generator.GenerateFromCsvString(csvString,"Birthdays","ConfigurationExample.xlsx")
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

ExcelReportsGenerator Class
ExcelReportsGenerator Members