Solved

Convert report to PDF

Posted on 2014-12-28
10
201 Views
Last Modified: 2014-12-30
Hi EE

Using Access 2010 I have the following

DoCmd.OutputTo acOutputReport, "rptHoistFaultReport", acformatpdf, Tlocation, False

running in Window 7 all works ok but in Window 8, I get the following   "The Output to Action was Cancelled"

I have the same problem using the following in Access 2003
blRet = ConvertReportToPDF("rptHoistFaultReport", vbNullString, Tlocation & ".pdf", False, False, 150, "", "", 0, 0, 0)
in Access 2003 I don't get any error messags it just doesn't save in PDF format
Works fine under Windows 7 but not in Windows 8.

It seem the common problem is Windows 8

Any help appreciated

chestera
0
Comment
Question by:chestera
  • 6
  • 2
  • 2
10 Comments
 
LVL 39

Accepted Solution

by:
als315 earned 250 total points
ID: 40521554
I don't see any problems with your code in Access 2010 (32 bit) in Windows 8 (64 bit)
Please, check validity and access rights of Tlocation
0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 250 total points
ID: 40521967
Try saving the PDF to the current path -- if that works OK, it is probably a security issue with the Tlocation path.
0
 

Author Comment

by:chestera
ID: 40522655
als315
There is no problem with the code as stated it works under windows 7 but not under windows 8. The Tlocation is not complex it's a test location   C:\Reports\File.pdf



Alan
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:chestera
ID: 40522660
Helen Feddema

Hi Helen

There is no problem with the code as stated it works under windows 7 but not under windows 8. The Tlocation is not complex it's a test location   C:\Reports\File.pdf

Not sure your meaning Security issue

Alan
0
 

Author Comment

by:chestera
ID: 40523134
Helen Feddema
I changed the location for testing purpose to the same folder as the .mde which is "C:\PPTworkshop" so
Tlocation becomes "C:\PPTworkshop\File.pdf" and it worked under windows 8. So you were on the right track. I will now experiment with different locations. Ultimately it will be saved to a server.


Alan
0
 
LVL 39

Expert Comment

by:als315
ID: 40523156
You should check access rights to folder  C:\Reports:
1. Select folder in explorer, press right mouse button and select "Properties"
2. Open Security tab and look at folder rights.
You should have full access rights to this folder
0
 

Author Comment

by:chestera
ID: 40523205
als315

I have found the problem.
Tlocation = "C:\PPTworkshop\Report" & Hoistnum & "FaultReport" & Tdate
Its the date that is the problem, if I remove Tdate
Tlocation = "C:\PPTworkshop\Report" & Hoistnum & "FaultReport"
It works

With the date added I get the error "The Output to Action is Cancelled"

Not sure why Tdate is a problem under Windows 8

Alan
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 40523877
That could depend on the date format -- if it is mm/dd/yyyy, for example, the slashes will not work in a file name.  Try mm-dd-yyyy to avoid this problem.
0
 

Author Comment

by:chestera
ID: 40524297
Helen Feddema

My dates are always set,  in my case dd-mm-yyyy. Appreciated your help although a simple resolution I was going on this narrow track thinking Windows 8 was the problem not the location, until you and als315 suggested a location problem.
If you don't mind I will split the points between you and als315
0
 

Author Closing Comment

by:chestera
ID: 40524716
Thank you both for your help
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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
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…

803 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