Solved

Print Preview won't make PDF file with all pictures in the PDF file

Posted on 2014-09-15
5
525 Views
Last Modified: 2014-09-17
I have the following code in an onclick event of a command button.  The problem is that if I do a print preview of the report all of the pictures print on the report.  (There are 5 in total).  But when the report gets send to a PDF file only 3 of the pictures are there.  Two are missing.

Here is the code:

   
Dim strClientFolderName As String
    Dim strFilter As String
    Dim strPropertyAssetFolderName As String
    Dim strPropertyFolderName As String
    Dim strReportName As String

    strClientFolderName = TempVars!strPicturesDataPath & "\" & Trim(Me.cboClientName) & "\"
    strPropertyFolderName = strClientFolderName & Trim(Me.cboProperty) & "\"
    strReportName = "Asset Detail Report"
    
    If Not IsNull(Me.cboFilterBySelectionAsset) Then
        strFilter = "AssetN = " & Me.cboFilterBySelectionAsset
    End If

    DoCmd.OpenReport strReportName, acViewPreview, , strFilter, acHidden
    DoCmd.OutputTo acOutputReport, strReportName, acFormatPDF, strPropertyFolderName & strReportName & ".pdf"
    DoCmd.Close acReport, strReportName, acSaveNo

    FollowHyperlink strPropertyFolderName & strReportName & ".PDF"

Open in new window

0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 37

Expert Comment

by:PatHartman
ID: 40325379
Have you tried printing other records?  Is it always the same two controls that are empty?  Will those two pictures print if they are assigned to different controls?  Are the two pictures a different format from the ones that do print?
0
 

Author Comment

by:SteveL13
ID: 40325480
Here's the latest on this quirk.  All of the picture files are jpg file.  But get this...

I can run the report one time and all of the pictures do not appear in the pdf file.  The next time they may all appear.  They always all appear in the print preview.

?????????

Is driving me crazy!
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 40325641
I take it that images are very large?
There are limits to what Access is willing to do with large images on reports.
They can be worked around.
I have an article (actually two) on the subject
http://www.experts-exchange.com/Database/MS_Access/A_13519-Printing-many-large-images-in-MS-Access-reports.html
and
http://www.experts-exchange.com/Database/MS_Access/A_13779-More-Fun-with-Really-Large-High-Fidelity-Images-in-Access-Reports.html

To test and for fun, resize your images down until they are 200 dpi -- that is to say that if the control that displays them is 4 inches by 3 inches, resize the images to 800 x 600 pixels.

Do they then render to PDF?
I'll betcha they do.
If so, then have a look at my articles on the subject.

Nick67
0
 

Author Comment

by:SteveL13
ID: 40325716
How can I resize them down to 200 dpi?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40325765
Pick your poison.
How large are the originals?
How large are the controls?

For quick and dirty (it doesn't need to be exactly 200 dpi) use resize in MSPaint!
Figure out by what percentage you need to shrink them and have at 'er.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question