Loadpicture in OnFormat event

Posted by: pteranodon on 4 August 2017, 3:10 pm EST

  • Posted 4 August 2017, 3:10 pm EST

    The following code

    Sub OnFormat
    rpt.sections("detail").controls("imgfront").picture = LoadPicture(rpt.parameters("ImgFront").value)
    rpt.sections("detail").controls("imgback").picture = LoadPicture(rpt.parameters("ImgBack").value)
    End Sub

    in an rpx file results in a run-time error "Path/File Access error" "loadpicture".  The image files definitely exist.  The parameters are something like C:\Myfolder\My Subfolder\subsubfolder\my image.jpg.  The OS is Vista Home Basic and all Users have permissions to view and read the contents of My Subfolder.

    Also, the identical code, if not placed in a script but placed in the Detail_Format event in the designer does work.  Like this:

    public img1 as string
    public img2 as string

    Private sub detail_format()
    imgfront.picture = loadpicture(img1)
    imgback.picture = loadpicture(img2)
    end sub

  • Replied 4 August 2017, 3:10 pm EST

    Hello ,

    1) We do not support Active Reports 2.0 (COM) in Vista environment.

    2) I think rpt.parameters(...).value returns wrong data.

    I've attached the project which works fine under Vista Ultimate 64-bit.


    Sergey Romanov.

  • Replied 4 August 2017, 3:10 pm EST

    ActiveReports 2.0 (COM) <i>is</i> supported under Vista. See this announcement.

    If anyone is using ActiveReports 2.0 under Vista, or if you support Vista for your end users, you should use at least service pack 5 (build or later.

Need extra support?

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

Learn More

Forum Channels