PISystem.ExportCsv Method (Object, IList(Type), IList(String), 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.
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public string ExportCsv( Object exportObject, IList<Type> objTypes, IList<string> columnHeaders, CultureInfo culture )
Public Function ExportCsv ( exportObject As Object, objTypes As IList(Of Type), columnHeaders As IList(Of String), culture As CultureInfo ) As String Dim instance As PISystem Dim exportObject As Object Dim objTypes As IList(Of Type) Dim columnHeaders As IList(Of String) Dim culture As CultureInfo Dim returnValue As String returnValue = instance.ExportCsv(exportObject, objTypes, columnHeaders, culture)
public: String^ ExportCsv( Object^ exportObject, IList<Type^>^ objTypes, IList<String^>^ columnHeaders, CultureInfo^ culture )
member ExportCsv : exportObject : Object * objTypes : IList<Type> * columnHeaders : IList<string> * culture : CultureInfo -> string
Parameters
- exportObject
- Type: SystemObject
The object to return in CSV format. - objTypes
- Type: System.Collections.GenericIListType
An optional list of types that are to be exported. For example, for elements, if the user wanted to export attributes, but not ports or extended properties, the list should only contain typeof(AFElement) and typeof(AFAttribute). If null, all types owned by the export object will be exported. - columnHeaders
- Type: System.Collections.GenericIListString
The names of the desired columns whose values are to be exported. - 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.