Solved

Convert report to PDF

Posted on 2014-12-28
10
218 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
[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
  • 6
  • 2
  • 2
10 Comments
 
LVL 40

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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 40

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

688 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