Solved

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

Posted on 2014-09-15
5
499 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
  • 2
  • 2
5 Comments
 
LVL 35

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 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