Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

PIServer.ExportCsv Method (Object, IList(Object), IList(String), PIExportMode, CultureInfo)

PIServer.ExportCsv Method (Object, IList(Object), IList(String), PIExportMode, CultureInfo)

  • Last UpdatedNov 18, 2025
  • 3 minute read
PIServer.ExportCsv Method (Object, IList(Object), IList(String), PIExportMode, CultureInfo)
Exports the CSV representation of requested object(s) and returns it as a string. The supported objects include PI Points, PI DigitalStateSets, PI Identities, or PI IdentityMappings.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public string ExportCsv(
	Object exportObject,
	IList<Object> objContexts,
	IList<string> columnHeaders,
	PIExportMode exportMode,
	CultureInfo culture
)
Public Function ExportCsv ( 
	exportObject As Object,
	objContexts As IList(Of Object),
	columnHeaders As IList(Of String),
	exportMode As PIExportMode,
	culture As CultureInfo
) As String

Dim instance As PIServer
Dim exportObject As Object
Dim objContexts As IList(Of Object)
Dim columnHeaders As IList(Of String)
Dim exportMode As PIExportMode
Dim culture As CultureInfo
Dim returnValue As String

returnValue = instance.ExportCsv(exportObject, 
	objContexts, columnHeaders, exportMode, 
	culture)
public:
String^ ExportCsv(
	Object^ exportObject, 
	IList<Object^>^ objContexts, 
	IList<String^>^ columnHeaders, 
	PIExportMode exportMode, 
	CultureInfo^ culture
)
member ExportCsv : 
        exportObject : Object * 
        objContexts : IList<Object> * 
        columnHeaders : IList<string> * 
        exportMode : PIExportMode * 
        culture : CultureInfo -> string 

Parameters

exportObject
Type: SystemObject
The object to return in CSV format.
objContexts
Type: System.Collections.GenericIListObject
An optional list of PI Point classes or types that are to be exported.
columnHeaders
Type: System.Collections.GenericIListString
The names of the desired columns whose values are to be exported.
exportMode
Type: OSIsoft.AFPIExportMode
One or more of the PIExportMode values which indicates how data should be exported. Only SimplifiedConfigStrings and AppendUnitsOfMeasure are valid for CSV export. Others are ignored.
culture
Type: System.GlobalizationCultureInfo
The culture-specific settings to be used for conversion of times, dates, floating-point values, etc. If , the current culture will be assumed. If the invariant culture is specified, then DateTime's will be output in Utc time.

Return Value

Type: String
Returns the CSV representation of the exported objects. The values of the requested properties of the exported objects will be included.

Remarks

The CSV representation of the objects is generated and returned in string format. This method can be expensive in terms of memory for large exports since the entire CSV string representation must be held in memory. Consider using one of the other overloads.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in