Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-09-15
5
Medium Priority
?
542 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 39

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 2000 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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