Solved

When I print an MS Access Report to PDF, my hyperlinks changes and doesn't work

Posted on 2011-09-23
19
432 Views
Last Modified: 2012-08-13
When i create a report in MS Access 2007, i have a hyperlink to a particular file on my hard drive. That works great. However, the problem occurs when I save the report to .pdf, the hyperlink clicks properly but it replaces any spaces in the path or file name with a %20. Then it wants to allow it to follow the path but the path is incorrect. How do we work around this issue so the file/path name doesn't create a %20 on every space? Thanks!
0
Comment
Question by:tols12
  • 9
  • 5
  • 3
  • +1
19 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36590271
Use folders and file without spaces.  This is a known problem and removing the spaces from the folder and file names is the only sure solution.  On the internet with 'http://www.mysite.com/', spaces in file names should be replaced with %20 according to the 'rules'.  So Adobe is creating 'http' links according to the rules but your files are not on the internet but local to your computer so things get confused.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36590498
Something more is going on that is wrong though.
Save the shim I posted to the desktop.
It has a link to the filesystem with a space in it.
Double-click the file.
Hover the mouse over the link.
You will see the %20
Yet, in IE, the link works
<How do we work around this issue so the file/path name doesn't create a %20 on every space? >
We don't.
As noted, that is correct syntax, and works in IE
<Then it wants to allow it to follow the path but the path is incorrect>

The question is "Why is the path not working in the PDF version?"

Post a PDF
test1.htm
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 167 total points
ID: 36590654
If you put a %20 in a "file:\\My%20Picture.jpg" link, IE won't open that.  It will open "file:\\My Picture.jpg".  This came up last month.  There is a difference in the way IE handles 'file:\\' and 'http://'.
0
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.

 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 167 total points
ID: 36590694
@DaveBaldwin
This is the guts of the first shim
<html>
<body>
<a href = "C:\Program Files"> here </a>
</body>
</html>

And it opens Explorer to the folder.

If I change it to
<html>
<body>
<a href = "C:\Program Files"> here </a><br>
<a href = "file:///C:\Program Files"> here, too </a>
</body>
</html>

IE will also open both links--and when you hover over both, IE shows the %20

If I change it to
<html>
<body>
<a href = "C:\Program Files"> here </a><br>
<a href = "file:///C:\Program Files"> here, too </a><br>
<a href = "file:///C:\Program%20Files"> here, three </a>
</body>
</html>


Try it!  I just did to make sure
All three links work on IE9 32-bit on Win7-x64
As these are links to the file system, they should NOT be http://

@tols12, something odd is happening in the rendering of the pdf, but without a sample that is hard to determine

For fun, I want to see if this link will work straight-up in a post
file:///C:\Program%20Files
test1.htm
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36590700
Ok, that one didn't
What about this one?
test
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36590707
IE Grabs it, thows http:// in front and then it doesn't work
http://file///C:/Program%20Files.
Is that happening with the PDF.  Then it's a zone thing.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36590708
I was using IE8 on XP so it may be different.  But I think the problem may be that Adobe is making 'http' links and not 'file' links.  But until @tols12 tells us, we won't know.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36590716
Access 2007.
Can and should be the MS plug-in and no Adobe on the render side.
But agreed, speculating without evidence would be...fun...not productive ;)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36593159
My question would be why there is a need to navigate to a file from a PDF?
(Why not just create a shortcut to the file?)

Is there something specific about this file that it needs to be accessed via a PDF, created from a report with hyperlinks?

Jeff
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36593349
I haven't played much with hyperlinks.  On paper, they are just formatting.  Most things in print preview aren't highlightable/selectable/clickable.  Are hyperlinks different?  Or are we dealing with a form?  More speculation :)
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36593592
"hyperlinks" in both Excel and Adobe PDF are active links to web pages... except that the question above is about links to files and that's where the formatting question or problem comes in.  Your examples are fine except that the links in question are not in web pages, they are just links in Excel and Adobe PDF.  That makes the 'rules' different.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36593635
You can store hyperlinks in an Access table.  They are clickable.  Links on a form are clickable too.  What @boag2000's post made me wonder is what links on a Report Print Preview are like.  Most report preview elements are NOT interactive.  For example, a command button on a report print preview is not an active control. Is a hyperlink?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36593651
Huh?  I see no mention of 'Report Print Preview' except in your post.  I should have said "hyperlinks" in both Access and Adobe PDF are active links to web pages.  The question is about printing from Access to PDF and having spaces in the links converted to '%20'.

I wish @tols12 would respond to his question here.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 36593681
<Grin>The question title is clearly 'Report' and the question text is 'when I create a report...'. That can't be design view, and can't be paper.  That leaves print preview or one of the new modes of A2007+
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 166 total points
ID: 36594213
In Access 2007 and above, if the report is opened in "Report View" (the default in 2007 and newer) you can "interact" with the report. (Click/follow hyperlinks, Filter, Click buttons, ...etc)
This is not possible in "Print Preview"

Both views have there Pros and Cons...

But I am still hazy on the need to link to a document from a pdf...?
0
 

Author Comment

by:tols12
ID: 36944853
I am trying a few of your options. I will reply in a day or so...
0
 

Author Comment

by:tols12
ID: 37024939
Ok, i think as mentioned it is because i have spaces in the names of my documents. I have over 7,000 documents and the majority have spaces. Is there a way to take out the spaces of these documents all at the same time so i don't have to delete the spaces one by one?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 37025148
I doubt that spaces in names are the source of your grief.
A hyperlink gets spaces replaced by '%20' and functions just fine.

Do ANY of your hyperlinks work?
If you take the spaces out of one, does it then work, where before it did not?

The three experts who have replied to your question have speculated about your issue and asked for more information.
Please go through the posts and reply to our inquiries, and remove some of the uncertainty about what you are doing.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37025149
I'm sure there is a way, but that would need to be a separate question.

I'm still curious about the need for this functionality...
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
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 …

713 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