PIServer.ExportCsv Method (Object, IList(Object), IList(String), PIExportMode, CultureInfo, String, EventHandler(AFProgressEventArgs))
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Exports the representation of requested object(s) in comma-separated (CSV) format to a file.
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 void ExportCsv( Object exportObject, IList<Object> objContexts, IList<string> columnHeaders, PIExportMode exportMode, CultureInfo culture, string file, EventHandler<AFProgressEventArgs> eventHandler )
Public Sub ExportCsv ( exportObject As Object, objContexts As IList(Of Object), columnHeaders As IList(Of String), exportMode As PIExportMode, culture As CultureInfo, file As String, eventHandler As EventHandler(Of AFProgressEventArgs) ) 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 file As String Dim eventHandler As EventHandler(Of AFProgressEventArgs) instance.ExportCsv(exportObject, objContexts, columnHeaders, exportMode, culture, file, eventHandler)
public: void ExportCsv( Object^ exportObject, IList<Object^>^ objContexts, IList<String^>^ columnHeaders, PIExportMode exportMode, CultureInfo^ culture, String^ file, EventHandler<AFProgressEventArgs^>^ eventHandler )
member ExportCsv : exportObject : Object * objContexts : IList<Object> * columnHeaders : IList<string> * exportMode : PIExportMode * culture : CultureInfo * file : string * eventHandler : EventHandler<AFProgressEventArgs> -> unit
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 PIExportMode.SimplifiedConfigStrings and PIIExportMode.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. - file
- Type: SystemString
The file to which the exported Csv information should be written. If the file already exists, it will be overwritten. - eventHandler
- Type: SystemEventHandlerAFProgressEventArgs
Delegate used to receive progress indication on operations.
Remarks
Exports the CSV representation of requested object(s) and writes it to a file