Images in reports

A

Ade

I am using a text field in a table that contains the path to a picture for
each record. The images in the report are contained in an image control
along with a text field in the detail section that has the image path as the
control source. So I have the table as the data source for a report that
displays record details along with it's picture.

When I start the report it displays the first page after quite a long time,
I can continue previewing through the report up to about page 7. There are 4
records per page. After page 8 it crashes with a memory message and a
comment about not being able to display the image as it is the wrong format,
even though I am using the same image for each record for testing purposes.

If I try to print the report without previewing it will print 5 pages before
crashing out.

I have read a lot of information about converting the images to .bmp but I
still get the same result when I convert the .jpg to .bmp using image editing
software.

The average size of the .jpg images are about 90kb. Having tried sample
code that has been suggested in previous posts about converting jpg to bmp I
found that the code does not work as it contains 'Private' variable
declarations in event procedures such as
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Private ctr As Long

...and I get a error message informing me that this is illegal.

I have asked this many times in these forums before but is it possible to
have a report that displays / prints more than 25 images. If so how do I go
achieve this.

If you can point me in the right direction I would be most grateful
 
L

Larry Linson

Ade said:
I have asked this many times in these forums
before but is it possible to have a report that
displays / prints more than 25 images. If so
how do I go achieve this.

If you can point me in the right direction I
would be most grateful

I think the "right direction" would be MVP Stephen Lebans' site,
http://www.lebans.com, in re which see the following:

The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Stephen also has a freely downloadable ActiveX Control for displaying
pictures when the Office grahpics filters are not available.

Larry Linson
Microsoft Access MVP
 
A

Ade

Larry, I downloaded the sample code you suggested but I get an error message
with the line of code - 'SavePicture obj, "C\SL11-52"'
It does not appear to recognise the 'SavePicture' statement.

I have tried to set a reference as instructed -
"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"

I do not see the SAVETODISK metod listed anywhere in the code so do I need
to swap 'SAVETODISK' for SavePicture in the code?
I have set a reference to Microsoft OLE DB Service Component 1.0 Type
Library, is this the correct reference for the code to function?
 
A

Ade

Larry, I downloaded the sample code you suggested but I get an error message
with the line of code - 'SavePicture obj, "C\SL11-52"'
It does not appear to recognise the 'SavePicture' statement.

I have tried to set a reference as instructed -
"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"

I do not see the SAVETODISK metod listed anywhere in the code so do I need
to swap 'SAVETODISK' for SavePicture in the code?
I have set a reference to Microsoft OLE DB Service Component 1.0 Type
Library, is this the correct reference for the code to function?
 

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