Excel Reports
GenerateFromCsvString Method
Example 



KellermanSoftware.ExcelReports Namespace > ExcelReportsGenerator Class : GenerateFromCsvString Method
The string to use for the data
The name for the tab of the worksheet
Where to save the .xlsx file
Turn a CSV string into an Excel Workbook
Syntax
Public Sub GenerateFromCsvString( _
   ByVal csvString As String, _
   ByVal worksheetName As String, _
   ByVal filePath As String _
) 
Dim instance As ExcelReportsGenerator
Dim csvString As String
Dim worksheetName As String
Dim filePath As String
 
instance.GenerateFromCsvString(csvString, worksheetName, filePath)
public void GenerateFromCsvString( 
   string csvString,
   string worksheetName,
   string filePath
)
public:
void GenerateFromCsvString( 
   String^ csvString,
   String^ worksheetName,
   String^ filePath
) 

Parameters

csvString
The string to use for the data
worksheetName
The name for the tab of the worksheet
filePath
Where to save the .xlsx file
Example
ExcelReportsGenerator generator = new ExcelReportsGenerator(); //Trial Mode
//ExcelReportsGenerator generator = new ExcelReportsGenerator("place user name here", "place license key here"); //License Mode
 
string csvString = @"FirstName,LastName,Married,NumberOfChildren,Salary,BirthDate
John,Smith,True,3,""$60,000"",12/15/1977
Joe,Jones,False,0,""$30,000"",6/25/1993";
 
generator.GenerateFromCsvString(csvString, "Employees", "GenerateFromCsvStringExample.xlsx");
Dim generator As New ExcelReportsGenerator() 'Trial Mode
'Dim generator As New ExcelReportsGenerator("place user name here", "place license key here") 'License Mode
 
Dim csvString As String = "FirstName,LastName,Married,NumberOfChildren,Salary,BirthDate" & ControlChars.CrLf & "John,Smith,True,3,""$60,000"",12/15/1977" & ControlChars.CrLf & "Joe,Jones,False,0,""$30,000"",6/25/1993"
 
generator.GenerateFromCsvString(csvString, "Employees", "GenerateFromCsvStringExample.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