Loading...

gdpicturestatus=13 in msaccess report

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

gdpicturestatus=13 in msaccess report

Postby pgallowa » Tue Oct 20, 2009 12:23 am

What is the meaning of the gdpicturestatus=13 (UnknownImageFormat) when returned from GDViewer DisplayFromFile and is it OK to ignore it?

I am using a GDViewer object named StationImage in an MS Access report. This report prints a series of .jpg images whose paths are stored in the database. On one computer a dataset with 206 images works with all calls to the DisplayFromFile returning 0. On another computer the same dataset, gives a return value of 13 for all calls to DisplayFromFile. Both computers are running Win XP and Access XP, but the computer that works without error has 4GB RAM while the other computer has2GB RAM. However if I just ignore the return value of 13, the report displays and prints OK on the computer with less memory.

Here is the code in the report. (Note that I just change the "If lngRetVal = 0 Then" to "If lngRetVal = 0 Or lngRetVal = 13 Then" in order to ignore the return value of 13.)

Code: Select all
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
On Error GoTo Err_DisplayImage
    Dim strResult As String, strImagePath As String
    Dim lngRetVal As Integer
    strImagePath = Nz(Me!txtFilePathName)
    StationImage.CloseImage
    If Nz(strImagePath) = "" Then
        strResult = "No image name specified."
    Else
        lngRetVal = StationImage.DisplayFromFile(strImagePath)
        If lngRetVal = 0 Then
            strResult = ""
        Else
            StationImage.Clear
            Select Case lngRetVal
            Case 3
                strResult = "Out of memory."
            Case 10
                strResult = "Can't find specified image file."
            Case 13
                strResult = "Unknown image format."
            Case 22
                strResult = "Unsupported image format."
            Case Else
                strResult = "Error " & lngRetVal & " while displaying image."
            End Select
        End If
    End If
   
Exit_DisplayImage:
    Me!txtImageNote = strResult
    Exit Sub

Err_DisplayImage:
    Select Case Err.Number
    Case Else       ' Some other error.
        MsgBox "Unexpected error #" & Err.Number & ": " & Err.Description, vbCritical + vbOKOnly, "Error in Displaying Image"
        strResult = "An error occurred displaying image."
        Resume Exit_DisplayImage:
    End Select
End Sub
pgallowa
 
Posts: 2
Joined: Thu Aug 27, 2009 6:40 pm

Re: gdpicturestatus=13 in msaccess report

Postby pgallowa » Tue Oct 20, 2009 6:37 pm

On further investigation I realize that I was wrong about when the problem occurs. I get the gdpicturestatus=13 every time I attempt to run the report without first recompiling the code. When the error occurs no image displays even if I choose to ignore the return code. I was misled because I would edit the code to ignore the return code of 13, recompile, and then the report would work. The fix was actually just recompiling the code. I can make any change to the code, on some unrelated module or just adding a comment, then recompile and the report will work. If I then close the database and reopen it, the report will fail again, until I once again recompile the code.

I can not require a recompile each time the database is opened so I really need some help here. I am using gdpicturepro5 5.11.0.18. The viewer properties are set in the report design as shown in the attachment and the license number is set in the report open event.


Paula
Attachments
viewer_properties.jpg
pgallowa
 
Posts: 2
Joined: Thu Aug 27, 2009 6:40 pm


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: Bing [Bot] and 1 guest