DIAdem Help

Method: LoadResultsColumns for DataStore

  • Updated2024-09-12
  • 2 minute(s) read

Method: LoadResultsColumns for DataStore

Loads the definition of the properties columns for the search results list from a TDQ file in a data store.

If the TDQ file only contains a query and no column configuration, the column configuration of the search results list remains unchanged and DIAdem outputs an error message.

If the TDQ file contains a query and a column definition, DIAdem replaces the column configuration of the search results list with the loaded configuration. DIAdem uses the information in the TDQ file to determine the return type and loads the respective columns. If the TDQ file does not contain any information on the data type of the searched for property, DIAdem sets the data type to eNoType. In this case, change the data type manually.

Set oColumns = Object.LoadResultsColumns(FileName)
ObjectDataStore
Object with this method
FileNameString
Specifies the name and the path of the TDQ file.
oColumnsColumns
Returned object

The following example generates a search for properties in a data store and saves this search in a TDQ file: Then the example loads the TDQ file and loads the specified columns into the Data Portal:

VBScriptPython

 

'Creating a tdq file with result columns
Dim oMyDataStore, oMyQuery, oMyConditions, oMyResultsColumns, oMyResults
Call Data.Root.Clear()

Set oMyDataStore = Navigator.ConnectDataStore("ASAM Pass Fail Analysis Example " & ProgramVersionName)

Set oMyQuery = oMyDataStore.CreateQuery(eDataStoreQuery)
oMyQuery.ReturnType = "measurement"
Set oMyConditions = oMyQuery.Conditions
Call oMyConditions.Add("measurement","name","=","QT_32*")
oMyConditions.Logic = "C1"

Set oMyResultsColumns = oMyDataStore.CreateResultsColumns()
Call oMyResultsColumns.RemoveAll
Call oMyResultsColumns.Add("measurement","name")
Call oMyResultsColumns.Add("measurement","ID")

Call oMyDataStore.SaveQuery(ConfWritePath & "MyNewQuery.tdq", oMyQuery, oMyResultsColumns)
Set oMyResultsColumns = oMyDataStore.LoadResultsColumns(ConfWritePath & "MyNewQuery.tdq")
Set oMyQuery = oMyDataStore.LoadQuery(ConfWritePath & "MyNewQuery.tdq")
Call oMyDataStore.SearchProperties(oMyQuery, oMyResultsColumns, 100)
Set oMyResults = oMyDataStore.ResultsProperties
Call Navigator.LoadProperty(oMyResults)

See Also

Objects Overview