Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6

    Is it possible to print an Access Report as PDF with clickable Hyperlinks. 20yrs of search results=0

    Hi,



    Using Access 2016 Wondering if it is possible to print a pdf from an Access report where the the pdf displays clickable links.

    I am using the following syntax in the source of an unbound control in a report :

    ="Url#" & [Website] & "##" & [Website]

    Where "Url" is the hyperlink display text and [Website] is a field in a query with an website addresses (that vary for each record) stored in a table stored as text (rather than hyperlink) format.


    The unbound control format settings in the report are:

    "Is a hyperlink" = Yes
    "Display as hyperlink" = Always

    When viewing report in "reportview", the link shows the "Url" display name. The show tip is displayed correctly on mouse over showing the website address. When Clicking on the "url" hyperlink in the reportview, the desired website opens.

    When printing to pdf, the pdf prints correctly but the link which works in report view does nothing in the pdf. The format is shown as a hyperlink but selecting the hand in the pdf viewer, no click action works.

    I have searched without avail over Microsoft office / Office 365 and access forums for the past twenty years and see lots of people have the same question but cant find any real answer to this.

    Seems like basic functionality that no amount of searching or testing provides even a glimmer of confirmation if this is possible or not. I have tried using different pdf printers foxit, acrobat and others. All have settings to create clickable hyperlinks. I have looked to word, excel and powerpoint (very little on this for Access). All say is possible, simply cannot get it to work.

    Any suggestions greatly received even if is just confirmation is not possible despite clearly being possible from other applications.

    Cheers and thanks

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    It is as much to do with the app used to provide the pdf printer driver. The windows one is pretty basic, you may need the adobe driver

    or look at apps that enable you to edit a pdf once you have printed it

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Have never done this but would expect that the pdf version has no OnClick event (which I figure is handled by the hyperlink settings of the report). Did anyone in all of your research suggest using anchor tags as part of the url?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6
    Thanks for your reply @CJ_London

    I agree the windows pdf printer driver is basic. For this reason I downloaded and tested several other types as mentioned. When they all failed I subscribed to Adobe acrobat which as already reported made no difference either.

    Editing the printed pdf is not an option for two reasons.

    Firstly several hundred records each with individual Web addresses is not practical and would have to be programmed to run over every pdf generated in each print run.

    Secondly I am pretty sure from testing different control widths, the display text is truncated to the width of the control and there is no underlying Web address in the pdf. If no display text is used, the Web address also appears truncated to the control width.

    Conversely it is there in the report view in an access report because as reported the display text, mouse tip and underlying address all work as expected.

    Given the above do you have any other suggestions?

    Thanks
    Last edited by dawrightau; 03-14-2024 at 03:52 PM. Reason: Additional info

  5. #5
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6
    Hi @Micron. Thanks for your comments.

    Onclick events clearly work in other types of pdf, for example Web addresses in scientific journals work in all the pdf editors viewers I have used to test printing from Access.

    Regarding searches the only syntax I have found is separating display text, web address, sub Web address and, mouse tip is that described by Microsoft to include the # between them or ## if ommitting one of these items (ie in my case ommitting a sub address). This syntax clearly works for access report view but not clickable urls either with or without display text or mouse tips. I have seen some references to including a # at the end of the string as well ie :

    ="Url#" & [website] & "##" & [website] & “#“

    This also works in report view but not in the pdf.

    Yours is a good question however. The syntax is clearly recognised by access report view but not in pdfs.

    Can you advise what tags pdfs expect for clickable urls? I haven't found any from my searches.
    Last edited by dawrightau; 03-14-2024 at 04:07 PM. Reason: Additional info

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    do you have any other suggestions?


    have you tried using docmd.outputTo? Either to a pdf or perhaps to a word document and then use automation to open the document and save as pdf. this link may be of help

    https://m.youtube.com/watch?v=6Y8b97xw244

  7. #7
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I can't answer your last question, having no experience in this. What I had in mind was the anchor tag (<a href "URL here", Displayed Text </a> ) but I'm afraid I don't know how I'd implement it or if the control's hyperlink property would have to be Yes or No.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6

    Reply to both @Micron and @CJ_London - plus further tests and conclusion

    Thanks for your replies both @Micron and @CJ_London.

    Basic issue here is doesn't seem to be straight forward way (or information anywhere on the web) to print an Access report using any method with clickable web link with either display text or full web address formatted as a hyperlink. There is 20 years of people asking how, noone / no site microsoft, adobe or others with any viable solution.

    @CJ_London thank for your suggestion. Programming it is a possibility but cant find anyone who has had any success doing this from access to print a pdf report. Reluctant to try going down that rabithole.

    @Micron, had thought of trying to use href tag and searched for this but is html protocol rather than access or pdf. if replacing the control value ="<a href " & [Website] & ", Url </a>" it just comes up as text in access report. Cant find or see any other way to use href or tags css style sheet approach other than Microsoft access described approach to use # tags for working with display text, web address, sub address and tooltips when working with hyperlinks. As previously reported they work as expected within Access Report View but when printing to pdf, there is blue underlined display text as if it was a link and both underlying address and clickable link functionality is lost.

    I have reviewed used 3 approaches to browse internal PDF structure and confirmed Access doesn't print the underlying address or hyperlink tags within the outputted pdf:

    1. Using content tags in adobe acrobat and browsing the internal pdf structure per instructions here https://help.illinoisstate.edu/acces...be-acrobat-pro
    2. Browsing detailed structuring using preflight inspections per instructions here https://helpx.adobe.com/au/acrobat/u...robat-pro.html.
    3. Have also used PDFUX to browse internal pdf structure and using https://pdfux.com/inspect-pdf/ (This is a nightmare of xml data to review and manually expand, even just for a test pdf of only a few lines of web links versus my report has several hundred records)

    Using all 3 approaches I have reviewed internal structure, printing as pdf using any print driver including adobe acrobat pro, the web address is missing, the display text "Url" is only text from printing to (relating to the field / control with hyperlink text).

    I used the same tools / methods to inspect pdfs with hyperlinks (and display text versus web address alone) produced from word, excel and powerpoint (where similarly 20 years of questions of how to retain clickable links)

    From these texts (and help on web) I resolved that when a office app (other than Access) prints to a pdf using Microsoft Print as pdf, adobe acrobat, foxit Bullzip, NitroPro and other pdf print drivers, a web address or when using display text, address and tooltip, the underlying web address, tooltip is lost and the link is not clickable.

    Conversely when "saving as a pdf", in Word, Excel and powerpoint, the web address is clickable and tooltip (showing address alone) or when using display text, displays and works as expected in the pdf. When printing as a pdf it doesnt.

    Thinking if I could export the report as a word document, I might be at least able to save as a pdf to get to work. Accordingly I tried exporting the access report using the access export report as rtf wizard. Good idea but only the blue underlined display text is carried through to the rdf document and the display tip and underlying web address is missing, same as when printing a PDF. So this isnt an option either.

    So like others I am at a complete loss to do a trivial task at lost a week of mucking around with no solution.

    Grateful if anyone else can cast light on a solution to such a simple need.

    Otherwise am concluding simply isn't possible. How hard can this be. What a waste of time.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post 4 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6
    Thanks Paul

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I tested Microsoft Print to PDF with Excel, Word, Access.

    All produced PDF with clickable links.

    Although, with Access, the first time I did the print to pdf the links opened the webpage. When I tried to replicate this, subsequent pdf did have clickable links but did not find the webpage. What I found was that the URL address had to be completely displayed within textbox. Textbox CanGrow set to Yes allowed hyperlink to wrap and fully display, but again, did not find link. So very long URLs could be a problem.

    Another curiosity, if I clicked hyperlink from within Access (say, from table Hyperlink field), report shows with clicked highlight and this carries over to the pdf.

    In all cases, the URL was fully displayed, not alias text. Did tests with alias text and that does fail.

    Arrived at same conclusion. Access cannot output a PDF with clickable hyperlink when alias text is used.

    Unless can do something with Word automation or Word merge, guess out of luck.
    If you want to explore that route, start with https://stackoverflow.com/questions/...20field%20code
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    dawrightau is offline Novice
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    6
    Hi @June7.

    Thanks for going to the trouble to test printing from Excel Word and Access.

    I didn't try doing an Cangrow setting on the web text control but I did try widening the control to display the web address without an Alias. The web text printed but wasn't clickable for me. Even if it was I am not really able to use access report for the purpose as is so many variable length web addresses but too much other information on the page in a layout that doesnt allow for long addresses. I could but it creates a very messy report.

    Unlike you, when printing from other Microsoft apps such as Word, Excel, PPT when I print links with alias they dont work. When I save as a PDF they do. It is not possible to save a MS Access report as a PDF so that isnt an avenue.

    Re using word. If I could get the report output into word at least I could use the "save as pdf option" and have alias text for websites clickable. However as previously advised only method to get report into word from Access is using using RTF export wizard. As mentioned previously, when using an alias text, this approach loses the web address in the rtf document and just displays the alias as underlined text without the address as a clickable link, same as with the pdf.


    However as the datasets being printed come from 10's of 000s of records that are collapsed into a cross tab table that is has too many columns for a A3 in orientation mode. So am busting the report up into column ranges, each report is 10 pages long on an A3 report in orientation layout with only a column 3 characters wide for the Alias "Url". Getting this into word isnt straightforward.

    So as you have concluded "Access cannot output a PDF with clickable hyperlink when alias text is used."

    Accordingly, unless someone else can suggest a solution, am going to put this on hold. I might try and seek support directly from Microsoft. If I get a successful outcome I will update the post.

    Thanks to all for contributions.
    Last edited by dawrightau; 03-18-2024 at 10:42 PM. Reason: correction

  13. #13
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Some questions - why are you using an unbound control? And for context, why not show an example of what you are trying to achieve?

    if replacing the control value ="<a href " & [Website] & ", Url </a>"
    don't think that is quite right - not tried it but see this link

    https://stackoverflow.com/questions/...extbox-in-form

    you would need to experiment with the isHyperlink property

    Another thought is to export to html then convert the html file to pdf - see this link
    https://www.access-programmers.co.uk...access.240468/

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Quote Originally Posted by dawrightau View Post
    Unlike you, when printing from other Microsoft apps such as Word, Excel, PPT when I print links with alias they dont work. When I save as a PDF they do. It is not possible to save a MS Access report as a PDF so that isnt an avenue.
    I did not test Word and Excel Print to PDF with alias links. As I said, in all cases the URL was fully displayed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Quote Originally Posted by dawrightau View Post
    Unlike you, when printing from other Microsoft apps such as Word, Excel, PPT when I print links with alias they dont work. When I save as a PDF they do. It is not possible to save a MS Access report as a PDF so that isnt an avenue.
    I said a clickable link from Print to PDF was produced only when URL was fully displayed in all cases - Excel and Word and Access.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Search by date and print report
    By mcmcd99 in forum Forms
    Replies: 6
    Last Post: 10-24-2017, 03:53 PM
  2. Replies: 1
    Last Post: 09-18-2017, 06:49 PM
  3. Search and Print Single Record in a Report
    By Candy_Tech in forum Reports
    Replies: 2
    Last Post: 01-12-2017, 01:20 PM
  4. Replies: 2
    Last Post: 05-06-2012, 11:10 AM
  5. Query Results are Clickable to Update Form
    By chasemhi in forum Forms
    Replies: 0
    Last Post: 03-24-2011, 08:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums