Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Apr 2008
    Posts
    189

    Question Unanswered: Print Report in PDF format

    Hello,
    Is there any way to print a Report in PDF format?

    I mean, imagine that I don't have the Adobe Acrobat or something else, and I want to print via VBA a Report to a PDF file... is that posible?

    I was looking at http://www.pdfforge.org/files/fly2pd...df-1_8_207.exe

    But does anyone knows if I can run libraries like this one in VBA?

    Thank you for your comments and ideas.
    Saludos,
    pepemosca

  2. #2
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    At the office I use something called Win2PDF. You install it on the machine that will be doing the printing. It installs a PDF printer on your PC. Then from code you can print to that printer. Win2PDF also has it's own API that allows you to manipulate the printer to do things you want. Example: you can give it the location of where to save the file and give it the name you want. Try a web search for Win2PDF as I'm sure that there are other similar products out there.

    Good Luck.

    C

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Paul

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Me too. dynapdf.dll ftw
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  5. #5
    Join Date
    Apr 2008
    Posts
    189

    Wink

    Thanks!

    I'll try them all later today!

    Thanks!!!!!!

    (I'll post some commets about how it works)

  6. #6
    Join Date
    Apr 2008
    Posts
    189

    Question

    Any ideas how to make this code works?

    Code:
        'Abro el reporte en vista diseño, pues tengo que cambiar el source
        DoCmd.OpenReport "iTemp - PDF", acViewDesign
        Reports("iTemp - PDF").Controls(0).SourceObject = "Form." & vNombreFormulario
        Reports("iTemp - PDF").Controls(0).Parent.DefaultView = 4
    My problem is with the line Reports("iTemp - PDF").Controls(0).Parent.DefaultView = 4

    What I want to do is to change the DefaultView of a Form to 4, which is "PivotChart".

    Also, this Form that I want to modify the property, is a "Subform" inside a Report called "iTemp - PDF".

    Ideas?

  7. #7
    Join Date
    Apr 2008
    Posts
    189

    Smile

    Besides my last question, works great!
    Thanks!

  8. #8
    Join Date
    Apr 2008
    Posts
    189

    Unhappy

    No!!
    Any ideas why do I have this error on Windows XP SP2 and Office 2003

    http://img297.imageshack.us/my.php?image=dibujoci9.jpg

    Thanks!

  9. #9
    Join Date
    Apr 2008
    Posts
    189
    I think the solution was to change on the modReportToPDF this:

    Code:
        ' Export the selected Report to SnapShot format ''''''''acOutputReport
        'DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", strPathandFileName
        
        'Modificado por pepemosca
        'http://support.microsoft.com/kb/934833/en-us#top
        DoCmd.OutputTo acOutputReport, RptName, acFormatSNP, strPathandFileName
    I have to try on my Co. computer.

  10. #10
    Join Date
    Apr 2008
    Posts
    189

    Question

    Nope, still not working.
    I mean, still have the same problem. Do I need to install something to make the Snapshot Format works?

    Any ideas why?

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You need to detail the problem better to get qualified help.

    I can only read English, so I have no idea what the problem is.

    For what it is worth, no, you don't have to do anything to make the snapshot format work.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  12. #12
    Join Date
    Apr 2008
    Posts
    189

    Question

    Quote Originally Posted by StarTrekker
    You need to detail the problem better to get qualified help.

    I can only read English, so I have no idea what the problem is.

    For what it is worth, no, you don't have to do anything to make the snapshot format work.
    Ok, acording to this forum:
    http://www.access-programmers.co.uk/...p/t-59327.html
    What I need to do is:
    Code:
    DoCmd.OutputTo acOutputReport, RptName, "FormatoSnapshot(*.snp)", strPathandFileName
    Is to change "FormatSnapshot" to "FormatoSnapshot"

    But I now get a different error:
    http://img143.imageshack.us/img143/7017/errorqx3.png

    Also, I tried to manually export the report to *.SNP and works ok.

    Ideas what to look for?




    BTW, is there any way to delete a post in the forum?

  13. #13
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Only moderators can delete posts on this forum.

    Did you try the "SnapshotFormat(*.snp)" solution mentioned in that topic? I see your code is "FormatoSnapshot(*.snp)", which is quite different. If so, what happened?

    The confusing thing to me is that this is seemingly the wrong topic. The topic is about outputting to PDF and here we are trying to debug a snapshot format ?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  14. #14
    Join Date
    Apr 2008
    Posts
    189

    Smile

    I start again.
    I'm trying to export a Report to PDF.

    But I have this rare problem.
    I can make it work with the http://www.lebans.com/reporttopdf.htm without any problem in A2007, but in A2003 I had some errors.

    Reading and reading, I realize that the problem was when I was exporting the Report to Snapshot (Is what is does the lebans code to convert to PDF).

    So, I read that I need to change in the code from "FormatSnapshot(*.snp)" to "FormatoSnapshot(*.snp)" because I'm using a Spanish version of the A2003.

    So after this change, I can make it work on the http://www.lebans.com/reporttopdf.htm mdb file, but I cannot make it works on my file.
    I get this error: http://img143.imageshack.us/img143/7017/errorqx3.png.

    And no PDF export is done. All my code works until the export.

    Was I clear? Sorry for my terrible English.

  15. #15
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Well that's much better, now I at least understand the problem!

    In short, your database crashes when you output to a snapshot format because it's the Spanish version. Wish I could tell you exactly how to solve the issue, but I don't know what your best course of action would be without considerable research.

    Have you tried installing a PDF printer driver and using that instead of using the solution on Leban's site?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •