reports with images(the error in format or size?)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marwa mohamed

    reports with images(the error in format or size?)

    salamo alikom hi all
    when i run report that includes image control linked to a field in the
    table that contains the image path(on the server)and the record source
    of the report contains over 30 records a messege shows saying:
    "Microsoft Access doesn't support the format of the file'file
    path\filename.j pg' or file is too large.Try converting the file to BMP
    or GIF format".
    I want to know which one is the problem (the size) or (the format is
    not recognized).bec ause solution for both is exactly the opposite
    i.e.: converting the format to BMP or GIF enelarges the image size.
    N.B.:
    This message shows only when the report have large number of records
    ,but when i choose 5 records for example it doesn't show and images
    shows normaly.
    The code used is:
    *************** *****
    Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
    If Me.image_path <> "" Then
    Me.site_photo.P icture = Me.image_path
    Else
    Me.site_photo.P icture = ""
    'MsgBox "This site doesn't have image"
    End If
    End Sub
    *************** ****

    thanks in advance hipe to recieve your reply soon.
  • Stephen Lebans

    #2
    Re: reports with images(the error in format or size?)

    Here are some steps you must follow to eliminate/reduce the error you
    are encountering.
    Items #4 and #5 resolve this issue 90% of the time. :

    1) Defrag your Hard drive. The temp printer output files Access
    generates can be very large when they contain images.

    2) Make sure the drive you point your Virtual Memory Manager to has
    several hundred MB's of free space.

    3) If you are still using Win9x then make sure you reboot before
    printing.

    4) You must turn off the "Loading Image" dialog via the Registry
    solution here:

    If you are using NT or higher you will have to update both
    HKEY_LOCAL_MACH INE and HKEY_CURRENT_US ER

    5) Load the Images into the Image control from the Detail Section's
    Print event NOT THE FORMAT EVENT.


    If you follow the above steps and your Report still fails then here are
    a couple of more solutions:

    6) Upgrade to the latest version of Windows at the very least. Better
    yet, upgrade to Access 2003 as well.
    or
    7) Use the PrintOUt method to only print out a limited number of pages
    at a time. Repeat as required.
    or
    8) THis solution seems to look after most of the memory issues. At
    runtime convert the Images to Bitmap format prior to loading them into
    the Image control. Here is some sample code:


    From: Stephen Lebans (StephenLebans@ mvps.org)
    Subject: Re: Images in Reports
    View: Complete Thread (18 articles)
    Original Format
    Newsgroups: microsoft.publi c.access.report s
    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(Ca ncel As Integer, PrintCount As Integer)

    Private ctr As Long

    ctr = ctr + 1

    Select Case ctr
    Case 1
    Me.Image10.Pict ure = CreateBitmapFil e("C:\A.jpg")

    Case 2
    Me.Image10.Pict ure = CreateBitmapFil e("C:\b.jpg")

    Case 3
    Me.Image10.Pict ure = CreateBitmapFil e("C:\c.jpg")
    ctr = 0

    Case Else
    ctr = 0

    End Select

    End Sub

    Private Sub Report_Open(Can cel As Integer)
    ctr = 0
    End Sub


    Private Function CreateBitmapFil e(fname As String) As String

    Dim obj As Object

    Set obj = LoadPicture(fna me)
    If Not IsNull(obj) Then

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


    CreateBitmapFil e = "C:\SL11-52"
    Set obj = Nothing

    End Function



    --

    HTH
    Stephen Lebans

    Access Code, Tips and Tricks
    Please respond only to the newsgroups so everyone can benefit.


    "marwa mohamed" <marwasliman@ho tmail.com> wrote in message
    news:76f7b1a9.0 402230053.6e70f 390@posting.goo gle.com...[color=blue]
    > salamo alikom hi all
    > when i run report that includes image control linked to a field in the
    > table that contains the image path(on the server)and the record source
    > of the report contains over 30 records a messege shows saying:
    > "Microsoft Access doesn't support the format of the file'file
    > path\filename.j pg' or file is too large.Try converting the file to BMP
    > or GIF format".
    > I want to know which one is the problem (the size) or (the format is
    > not recognized).bec ause solution for both is exactly the opposite
    > i.e.: converting the format to BMP or GIF enelarges the image size.
    > N.B.:
    > This message shows only when the report have large number of records
    > ,but when i choose 5 records for example it doesn't show and images
    > shows normaly.
    > The code used is:
    > *************** *****
    > Private Sub Detail_Format(C ancel As Integer, FormatCount As Integer)
    > If Me.image_path <> "" Then
    > Me.site_photo.P icture = Me.image_path
    > Else
    > Me.site_photo.P icture = ""
    > 'MsgBox "This site doesn't have image"
    > End If
    > End Sub
    > *************** ****
    >
    > thanks in advance hipe to recieve your reply soon.[/color]

    Comment

    • Steve

      #3
      Re: reports with images(the error in format or size?)

      "Stephen Lebans" <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote in message news:<UIp_b.103 001$IF6.3062543 @ursa-nb00s0.nbnet.nb .ca>...

      Stephen,

      On your web site, you have a utility (ExportOLEtoJpe gVer16) for
      converting MS Access images to JPEG's. As this was written for Access
      2000, what chg's. are necessary to use this tool in Access 2003?

      Thx!

      Comment

      • Stephen Lebans

        #4
        Re: reports with images(the error in format or size?)

        No changes are required. The code will work with A2K or higher.
        :-)
        --

        HTH
        Stephen Lebans

        Access Code, Tips and Tricks
        Please respond only to the newsgroups so everyone can benefit.


        "Steve" <sdrichardson@d irecway.com> wrote in message
        news:be02422b.0 403041921.44434 fca@posting.goo gle.com...[color=blue]
        > "Stephen Lebans"[/color]
        <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote in
        message news:<UIp_b.103 001$IF6.3062543 @ursa-nb00s0.nbnet.nb .ca>...[color=blue]
        >
        > Stephen,
        >
        > On your web site, you have a utility (ExportOLEtoJpe gVer16) for
        > converting MS Access images to JPEG's. As this was written for Access
        > 2000, what chg's. are necessary to use this tool in Access 2003?
        >
        > Thx![/color]

        Comment

        Working...