CSV Reports
CustomColumnNames Property
Example 



KellermanSoftware.CsvReports Namespace > CsvWriter Class : CustomColumnNames Property
List with custom column names. Defines order and names of columns
Syntax
Public Property CustomColumnNames As List(Of CsvColumn)
Dim instance As CsvWriter
Dim value As List(Of CsvColumn)
 
instance.CustomColumnNames = value
 
value = instance.CustomColumnNames
public List<CsvColumn> CustomColumnNames {get; set;}
public:
property List<CsvColumn^>^ CustomColumnNames {
   List<CsvColumn^>^ get();
   void set (    List<CsvColumn^>^ value);
}
Example
CsvWriter csvWriter = new CsvWriter(); //Trial Mode
//CsvWriter csvWriter = new CsvWriter("place user name here", "place license key here"); //License Mode        
 
csvWriter.CustomColumnNames = new List<CsvColumn>{
    new CsvColumn { PropertyName = "LastName", HeaderName = "Customer Last Name" },
    new CsvColumn { PropertyName = "FirstName", HeaderName = "Customer First Name" }
};
 
List<Person> persons = new List<Person>();
Person person1 = new Person();
person1.FirstName = "John";
person1.LastName = "Smith";
person1.BirthDate = DateTime.Now.AddDays(-1);
persons.Add(person1);
 
Console.WriteLine("CustomColumnNames");
string result = csvWriter.ClassListToCsvString(persons);
Console.WriteLine(result);
Dim csvWriter As New CsvWriter() 'Trial Mode
'CsvWriter csvWriter = new CsvWriter("place user name here", "place license key here"); //License Mode        
 
csvWriter.CustomColumnNames = New List(Of CsvColumn) From { _
    New CsvColumn With {.PropertyName = "LastName", .HeaderName = "Customer Last Name"}, _
    New CsvColumn With {.PropertyName = "FirstName", .HeaderName = "Customer First Name"} _
}
 
Dim persons As New List(Of Person)()
Dim person1 As New Person()
person1.FirstName = "John"
person1.LastName = "Smith"
person1.BirthDate = Date.Now.AddDays(-1)
persons.Add(person1)
 
Console.WriteLine("CustomColumnNames")
Dim result As String = csvWriter.ClassListToCsvString(persons)
Console.WriteLine(result)
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

CsvWriter Class
CsvWriter Members