Is there a size limitation on reports, especially in displaying im

G

Guest

I have a db where one of the fields contains the path to a jpg file. I've got
a report that runs and in the detail section I have VB code that loads the
path into a picture control. In the event that the image file is not found I
load a NoPicture.bmp. It functions properly for the first maybe 300 or 400
images (each are roughly 200 kb, although is this an issue since we've linked
the images using code?) Finally, this error message appears and the process
of adding images to the report stops:
"The expression On Format you entered as the event property setting
produced the following error: Microsoft Access doesn't support the format
of the file: ..." and then displays the name of the file, so it didn't
load the picture. I then delete that entry from the report
table, and it moves on to another file that it says it doesn't recognize.
There are no problems with the path names of these files.
It feels like I'm bumping up against a size limitation, if it is does
anybody know what it is? If not then what do you suppose the problem is?
 
G

Guest

Jon,

Not really a solution for your problem.

What the cause is, is a mystery to me but all reports with
images will prang eventually. As a workaround you can use
bitmaps instead of jpgs. I get to about 5000 pages before
weird errors start coming up. Using jpgs or pngs I only
got a fraction of that many pages.

If converting all your images isn't an option you may need
to break your report up into 300 page lots .... yuck ... ??


Not much help I'm afraid,

Terry
 
S

Stephen Lebans

You can convert the Jpegs on the fly prior to loading the images into
the Image control. Also make sure you jhave the Loading Image dialog
turned off via the registry. Code to convert the Jpegs to Bitmaps at
runtime is here:

Here is the code I use to convert any Jpeg, Gif, or Metafile into a BMP.
Rather than using one of my API solutions I have cheated and set a
Reference to Standard OLE Types type library in order to get at the
SAVETODISK method. But no ActiveX controls are required


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Private ctr As Long

ctr = ctr + 1

Select Case ctr
Case 1
Me.Image10.Picture = CreateBitmapFile("C:\A.jpg")

Case 2
Me.Image10.Picture = CreateBitmapFile("C:\b.jpg")

Case 3
Me.Image10.Picture = CreateBitmapFile("C:\c.jpg")
ctr = 0

Case Else
ctr = 0

End Select

End Sub

Private Sub Report_Open(Cancel As Integer)
ctr = 0
End Sub


Private Function CreateBitmapFile(fname As String) As String

Dim obj As Object

Set obj = LoadPicture(fname)
If Not IsNull(obj) Then

SavePicture obj, "C:\SL11-52"
DoEvents
End If


CreateBitmapFile = "C:\SL11-52"
Set obj = Nothing

End Function





--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top