DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Datafinder results into a excel file

I need to save the Datafinder results into a file.  As shown in the image, I want to save flename, folder, date. Please help.

0 Kudos
Message 1 of 3
(3,850 Views)
Hi llx,
 
You should be able to access that information programmatically through the ResultsList object.
 
Search Results List (DataFinder)
 
Object: ResultsList <DataFinder>
 
Property: ResultsProperties for ResultsList <DataFinder>

 

Jason H
Automated Test Software R&D
0 Kudos
Message 2 of 3
(3,819 Views)

Hi IIx,

 

Here's code that puts your search results on the Windows clipboard, ready to paste into Excel:

 

OPTION EXPLICIT
Dim i, j, iMax, jMax, Elements, Columns, ColPaths, ReturnType, Msg, Prop

If Navigator.Display.CurrDataProvider.IsKindOf(eDataFinder) Then
  Set Elements = Navigator.Display.CurrDataFinder.ResultsList.ResultsElements
  Set Columns = Navigator.Display.CurrDataFinder.ResultsList.Columns
  ReturnType = Navigator.Display.CurrDataFinder.QueryForm.GetCurrQuery.ReturnType
  iMax = Elements.Count
  jMax = Columns.Count
  IF iMax > 0 AND jMax > 0 THEN
    ReDim ColPaths(jMax)
    FOR j = 1 TO jMax
      Msg = Msg & Columns(j).Property
      IF j < jMax THEN Msg = Msg & vbTAB
      ColPaths(j) = Columns(j).GetPath(ReturnType)
    NEXT ' j
    Msg = Msg & vbCRLF
    FOR i = 1 TO iMax
      FOR j = 1 TO jMax
        Set Prop = Elements(i).Properties(ColPaths(j))
        IF Prop.DataType = DataTypeDate THEN
          Msg = Msg & Prop.Value.VariantDate
        ELSE
          Msg = Msg & Prop.Value
        END IF
        IF j < jMax THEN Msg = Msg & vbTAB
      NEXT ' j
      Msg = Msg & vbCRLF
    NEXT ' i
    MsgBox "The Search Results have been sent to the Windows clipboard"
    Call TextToClipboard(Msg)
  END IF
END IF

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(3,817 Views)