|
|
PrintFailure.zip is an Access97 MDB containing a report that fails during the Access formatting process prior to being spooled to the Printer Driver. Here is a NewsGroup post of mine containing 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.
Hi Steve, I would add two other items. 1) Turn of the "Importing Image" dialog window via the registry keys as outlined here: http://www.mvps.org/access/api/api0038.htm Make sure you do it for all Image types that you using that contain the key. 2) Change all of the Images to Bitmaps at runtime. I have been able to print previously unprintable reports by doing this last step. Here's a previous post of mine on the subject. From: Stephen Lebans (StephenLebans@mvps.org) Subject: Re: Images in Reports View: Complete Thread (18 articles) Original Format Newsgroups: microsoft.public.access.reports Date: 2002-09-16 18:46:39 PST Bruce I finally got a chance to test your method last night. It helped but only with the actual printing and not the Print Preview itself. I was able to print the failed Report directly to the printer or to a disk printer file so that's great! Don't get me wrong, it's still a good thing because at least you can print the report! Unfortunately Acess still runs out of resources when you page back and forth through Print Preview. I plan to spend some time onthis issue shortly. 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
Keywords: out of memory report convert Jpg Jpeg bitmap
|
|
|