www.Chart4.NET | Samples

Loads data from CSV (Comma Separated Values) content as a string.

Namespace:  UnifoChart.Hierarchy
Assembly:  UnifoChart.Hierarchy (in UnifoChart.Hierarchy.dll) Version: 2.6.0.0 (2.6)

Syntax

C#
public string LoadFromCsvContent(
	string FileContent,
	string CommaString
)
Visual Basic (Declaration)
Public Function LoadFromCsvContent ( _
	FileContent As String, _
	CommaString As String _
) As String
Visual Basic (Usage)
Dim instance As HierarchyData
Dim FileContent As String
Dim CommaString As String
Dim returnValue As String

returnValue = instance.LoadFromCsvContent(FileContent, _
	CommaString)
Visual C++
public:
String^ LoadFromCsvContent(
	String^ FileContent, 
	String^ CommaString
)
J#
public String LoadFromCsvContent(
	String FileContent,
	String CommaString
)
JScript
public function LoadFromCsvContent(
	FileContent : String, 
	CommaString : String
) : String
JavaScript
function LoadFromCsvContent(FileContent, CommaString);

Parameters

FileContent
Type: System..::.String
Valid CSV content.
CommaString
Type: System..::.String
The string or character that has to be treated as a comma (,) within the text.

Return Value

Returns blank if succeeded, error message otherwise.

Remarks

First line of text is the header row of content. The 'CommaString' parameter is to include any additional comma within the text. In the example given here, a "+" is included in the second row of text. So "+" is given as 'CommaString' to treat "+" as ','.

Examples

CopyC#
            hierarchy1.hpcData.LoadFromCsvContent( 
@"id,pid,text,value,tooltip,photo
1,,DT_Text1,Value1,ToolTip1,Photo1.png
2,1,Tex+t11xx,Value11,ToolTip11,Photo11.png
3,1,Text12,Value12,ToolTip12,Photo12.png
4,1,Text13,Value13,ToolTip13,Photo13.png
5,3,Text121,Value121,ToolTip121,Photo121.png
6,3,Text122,Value122,ToolTip122,Photo122.png
7,3,Text123,Value123,ToolTip123,Photo123.png", "+" );//+ in text will be translated to ,
            hierarchy1.hpcData.ExpandAll( );
            hierarchy1.Refresh( );

See Also