PIServer.ExportCsv Method (Object, IList(Object), IList(String), PIExportMode, CultureInfo)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
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: StringReturns 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.