Can't read .caption at runtime?

Posted by: davinaster on 4 August 2017, 2:38 pm EST

  • Posted 4 August 2017, 2:38 pm EST

    Hi --

    I'm a new AR user (I think my question makes that fairly obvious).  I'm trying to list the reports I have available by iterating through a specified directory, loading the layout and reading out the .captions property.  But it always returns empty.  I've had some success with the .UserData, but a) that data sometimes disappears, and I haven't been able to figure out exactly which conditions cause that to happen and b) I'd like to use that property for something else.

    I'd appreciate any help.


    <font face="Courier New" size="2">     Dim RptsDir As String
        RptsDir = pth & reports & "\"
        Dim fs, fldr, fls, fl
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set fldr = fs.GetFolder(RptsDir)
        Set fls = fldr.Files
        For Each fl In fls
            Dim rptName As String
            Dim AR As ActiveReport
            Set AR = New ActiveReport
            AR.LoadLayout s
            rptName = AR.Caption
  • Replied 4 August 2017, 2:38 pm EST

    The Caption property is intended for the VB designer window and is therefore not written out to the RPX file that you are loading.  If you open thi RPX file (it is in XML), you can see all of the changed properties that are saved with the report.  UserData should always be saved.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels