473,604 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Systemically OutPut Access Report To PDF

All,

I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and
have the Access report saved as a pdf in a directory specified by me the
programmer.

I have seen a posting by John Baker promoting a web-sight that has an mde
that one can reference in any database but after 30 days requires a
registration fee. Someone must have done some automation of this type. Any
help would be much appreciated.

Regards,

Mark C.
Nov 13 '05 #1
15 13283
"Mark C" <he******@yahoo .com> wrote:
I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and
have the Access report saved as a pdf in a directory specified by me the
programmer.


Creating PDF files from within Microsoft Access
http://www.granite.ab.ca/access/pdffiles.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #2
Access can do three things with a report:
It can print/preview, it can 'OutputTo', it can export the design as text.

Print/Preview means drawing the report on a windows canvas, and sending the
metafile either to a printer driver or to a screen driver.

OutputTo means (meant) a wizard loops through the report and exports the
details in a different format.

SaveAsText only export the design information, not data.

Since there is no PDF export wizard built into Access, the only ways you can
get PDF from a report are
(a) Write your own code to make PDF/Postscript documents.
(b) Use a printer driver that writes to a PDF/Postscript document.
(c) Use a PDF creator that will accept a Text/Rich Text/HTML/Excel/Word
document

(a) is unheard of, and (c) is really dodgy because the OutputTo wizard
notoriously miscalculates the size of text and truncates fields.

That leaves only (b). The full version of Acrobat comes with Distiller.
Distiller is one of the more difficult programs to automate, because Acrobat
is cross platform.

(david)
"Mark C" <he******@yahoo .com> wrote in message
news:zN******** ************@co mcast.com...
All,

I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and
have the Access report saved as a pdf in a directory specified by me the
programmer.

I have seen a posting by John Baker promoting a web-sight that has an mde
that one can reference in any database but after 30 days requires a
registration fee. Someone must have done some automation of this type. Any
help would be much appreciated.

Regards,

Mark C.


Nov 13 '05 #3
On Sat, 17 Jul 2004 21:11:41 -0700, "Mark C" <he******@yahoo .com> wrote:

Add a new printer in the control panel printer section. Get the driver from
Acrobat. Name it PDF printer.

Make a button that runs a macro that opens the report in print mode.
In my case, the first time I ran the macro a window opened and gave me a choice
of which printer to use. Chose PDF printer. Click *print*. When the printing
is done, Acrobat will open, give the file a name and save it or use the
default name which is the name of the report. Close Acrobat. With the report
still open in Access, click file/save. The next time you click on the macro
button, the only thing you will have to do is give the PDF file a name.

Chuck
....

All,

I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and
have the Access report saved as a pdf in a directory specified by me the
programmer.

I have seen a posting by John Baker promoting a web-sight that has an mde
that one can reference in any database but after 30 days requires a
registration fee. Someone must have done some automation of this type. Any
help would be much appreciated.

Regards,

Mark C.


Nov 13 '05 #4


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5
"Mark C" <he******@yahoo .com> wrote in message news:<zN******* *************@c omcast.com>...
All,

I have exhaustingly been looking through the newsgroups in search of a way
to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and
have the Access report saved as a pdf in a directory specified by me the
programmer.

I have seen a posting by John Baker promoting a web-sight that has an mde
that one can reference in any database but after 30 days requires a
registration fee. Someone must have done some automation of this type. Any
help would be much appreciated.

Regards,

Mark C.

Mark - I do have a sample access 97 database where I have put together
and automated the different components necessary to programatticall y
send an Access 97 report to a PDF file. This does require the full
version of Adobe Acrobat installed as custom because you need the
Acrobat PDFWriter printer that is not installed by default (at least
it was this way in Acrobat 5.0)

Here is an overview of what it does,
1. determine the current default printer
2. change the current printer to Acrobat PDF Writer
3. Modify the registry to save PDF to supplied path and document name
so PDF writer does not prompt for file name and location
4. change back to the default printer

If you are interested I can send you a copy.
Nov 13 '05 #6
dg*****@yahoo.c om (dgs5150) wrote:
Mark - I do have a sample access 97 database where I have put together
and automated the different components necessary to programatticall y
send an Access 97 report to a PDF file.


If you like I'd be happy to host that file on my website. Along with credit and your
email address. Or not if you'd prefer.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 13 '05 #7
I would differently like a copy of that sample database. I have talked to
the big bosses at my company and we have decided to go with the
http://ourworld.compuserve.com/homep...cg/acgsoft.htm method. I
downloaded and tested the Access 2000 version and it works wonderfully with
no user interaction other then them clicking a button. Sometimes you just
have to admit defeat.

Regards,
Mark C.
he******@yahoo. com


"dgs5150" <dg*****@yahoo. com> wrote in message
news:52******** *************** ***@posting.goo gle.com...
"Mark C" <he******@yahoo .com> wrote in message

news:<zN******* *************@c omcast.com>...
All,

I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full
version of Adobe Acrobat. I want the user to be able to click a button and have the Access report saved as a pdf in a directory specified by me the
programmer.

I have seen a posting by John Baker promoting a web-sight that has an mde that one can reference in any database but after 30 days requires a
registration fee. Someone must have done some automation of this type. Any help would be much appreciated.

Regards,

Mark C.

Mark - I do have a sample access 97 database where I have put together
and automated the different components necessary to programatticall y
send an Access 97 report to a PDF file. This does require the full
version of Adobe Acrobat installed as custom because you need the
Acrobat PDFWriter printer that is not installed by default (at least
it was this way in Acrobat 5.0)

Here is an overview of what it does,
1. determine the current default printer
2. change the current printer to Acrobat PDF Writer
3. Modify the registry to save PDF to supplied path and document name
so PDF writer does not prompt for file name and location
4. change back to the default printer

If you are interested I can send you a copy.

Nov 13 '05 #8
"Mark C" <he******@yahoo .com> wrote in message news:<3p******* *************@c omcast.com>...
I would differently like a copy of that sample database. I have talked to
the big bosses at my company and we have decided to go with the
http://ourworld.compuserve.com/homep...cg/acgsoft.htm method. I
downloaded and tested the Access 2000 version and it works wonderfully with
no user interaction other then them clicking a button. Sometimes you just
have to admit defeat.

Regards,
Mark C.
he******@yahoo. com


I admit defeat on creating standard Access Reports in PDF. Only
Microsoft can make money competing with free ;-). But, for those who
want to think outside the box of Access Report limitations my approach
is new and worthwhile. If you don't use the pdf printer drivers you
can do a lot more with presentation than standard Access Reports can.
I might still do code to create standard Access Reports directly in
pdf just for fun. I like Access Reports, but I'm all for any
techniques that stretch Access' abilities.

James A. Fortune
Nov 13 '05 #9
Caution: excessive windiness ahead

Maybe it is a moot point at this junction, but to anyone else who is
following this, I have just gone through this struggle. This is a summary of
what probably appears on the above links, but hopefully it helps. This uses
visual basic, so hopefully it is not an inappropriate post, but if anyone is
adventurous...

Two ways- PDFWriter, which in some ways was a bit easier for me. When you
print (i.e. DoCmd.OpenRepor t [defaults to printing unless you specify
acViewPreview) anything with PDFWriter selected as your default printer, it
first looks in the registry to see if there is a key indicating the name of
the next PDFWriter File to be output. So the trick is to write that
information in the registry beforehand (it is automatically deleted later.)

The problem I encountered with PDFWriter is the way it draws graphics
(non-postscript method, can't remember the name) makes it unacceptable if
the report includes tables or graphs.

So we move to PDF Distiller, which has a different methodology. I created a
new PDFDistiller printer so that I could have the files dropped off in a
general temp directory, which I then snatch the file from, rename it and put
it in an appropriate folder. (i.e. Add a new printer, choose as printer port
a PDF port pointing to c:\TempReports, choose any old printer driver, and
name the printer ProjReportsPDFW riter or ProjReportsDist iller. Then go to
the properties, and under the advanced tab go to drivers, and change it to
either the PDFWriter driver or AdobePS Acrobat Distiller depending on which
method you decide on.)

For both methods in access, I chose to specify an printer specific to the
reports I am printing. This way, I did not need to worry about default
printers or anything of that sort. This is accomplished by opening the
report, clicking "Setup" from the toolbar, which makes a "Page Setup"
dialogue box pop up. Click on the "Page" tab, and where it says "Printer for
YourReportNameH ere" click "Use Specific Printer", then click the "Printer"
button to choose specifics.

Damn, I'm long winded.

The trick here is that this essentially creates it's own instance of the
printer that exists only for that report, so any changes you want to make to
the Printing preferences after that point need to be approached through this
dialogue, rather than the usual Printers and Faxes Control Panel access.
(Either that, or make the changes in the Printers and Faxes window, change
it the Report to select a different printer, then change it back to the
original so it loads the newest settings). The PDFWriter preferences are
self explanatory, but for distiller to be automated, you must deselect the
following checkboxes in the Printing Preferences\"Ad obe PDF Settings" tab:
Do not send fonts to distiller, View Result in Acrobat, Prompt for the PDF
Filename, Ask to Replace existing PDF File (All unchecked!).

My code follows.

Hopefully this helps.
Taylor

P.S. I am using Acrobat 5.0- I installed 6.0 but too much bloat, had me
running back.

*************** *************** *************** *************** *************** *
PDFWriter method: I kind of jump into the code (skip the declarations), but
hopefully this helps. This is originally for word, and I tried to adapt it
for Access, but I really did not go nuts testing it. I use the Distiller
method.
*************** *************** *************** *************** *************** *

DocSaveName = "C:\Path\PDFNam eStringHere" 'This was declared earlier as
a string

' Create Registry Key that tells acrobat the PDF Save name
Call RegistryValue(D ocSaveName) 'This function follows, skip to it to
see what happens

DoCmd.OpenRepor t "2005 Packets Coversheet"

'Note: registry key is automatically deleted after use
'Quit

End Function

'This creates the registry key, needs a reference to (I think...) Windows
Script Host Object Model

Sub RegistryValue(D ocSaveName As String)
Dim WshShell As IWshRuntimeLibr ary.WshShell
Dim AcroRegVal As String
Dim AcroName As String
AcroName = DocSaveName & ".pdf"

Set WshShell = CreateObject("W script.Shell")
AcroRegVal = "HKEY_CURRENT_U SER\Software\Ad obe\Acrobat
PDFWriter\PDFFi leName"
WshShell.RegWri te AcroRegVal, AcroName

' I used the following functions when I was in my test phase to make sure it
was writing to the reg correctly
'strValue = WshShell.RegRea d(AcroRegVal)
'MsgBox strValue

End Sub

*************** *************** *************** *************** *************** *
****PDF Distiller method: Much cleaner looking reports, bit more trouble.
Again, I am jumping in...
*************** *************** *************** *************** *************** *
Sub PrintReports(Co ordinatorName As String)

'CoordinatorNam e is criteria I am passing to the report, so it opens only
the
'reports corresponding to a specific coordinator

Dim ReportFormInfo As String 'Title passed from Report to PDF Distiller -
'not necessarily the name of the Report itself,
'but rather the caption field in report properties. '
'It is automatically passed, I only need it in order to rename the PDF
later...

Dim CurPath As String 'Where the database is located now
Dim OldPath As String 'Temporary path where Distiller dumps the PDF
Dim SavePath As String 'Where I want the renamed PDF to end up

OldPath = "C:\Temp\" 'That is where PDF Distiller dumps all my files after
they are made

ReportFormInfo = "2005 Survey Info For Forms.pdf" 'Default name Distiller
saves the Report as

CurPath = Application.Cur rentProject.Pat h & "\" 'Say the db is located on
"C:\ReportD B\"

SavePath = CurPath & CoordinatorName & "\" 'I will ultimately save the new
PDF
'in "C:\ReportDB\Jo hn Smith" (the name of the coordinator)

DoCmd.OpenRepor t "2005 Envelopes Summary Form", , , "[Coordinator] = " &
CoordinatorName 'pass the criteria

Call CreateFolder(Sa vePath, OldPath, ReportFormInfo)

End Sub

*************** *************** *************** *************** *************** *
This renames the PDF meaningfully, creates folders for it, etc.
*************** *************** *************** *************** *************** *

Sub CreateFolder(Sa vePath As String, OldPath As String, ReportFormInfo As
String)
Dim fso As IWshRuntimeLibr ary.FileSystemO bject
Dim OldFile As String
Dim NewFile As String

Set fso = CreateObject("S cripting.FileSy stemObject")
If Not fso.FolderExist s(SavePath) Then 'checks to see if
"C:\ReportDB\Jo hn Smith" folder exists
fso.CreateFolde r (SavePath) 'If not, Creates the folder
"C:\ReportDB\Jo hn Smith"
End If

If fso.FileExists( OldPath & ReportFormInfo) Then
'checks for "C:\Temp\20 05 Survey Info For Forms.pdf"
fso.CopyFile OldPath & ReportFormInfo, SavePath & ReportFormInfo
'copies it to "C:\ReportDB\Jo hn Smith\2005 Survey Info For Forms.pdf"
End If

End Sub
Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
23865
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how to use a database table but all I want to do now is to click a command button to display this access report. Any suggestions please ?????
2
8115
by: Vikrant | last post by:
Hey Friends I need to export an Access Report using a filter. I am using the method OutputTo m_pDoCmd->OutputTo( 3, // asOutputReport COleVariant(strReportName), // <report name> COleVariant(_T("HTML (*.html)")), // acFormatHTML
8
3504
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
2
2799
by: heatherpanek | last post by:
Does anyone know how to create a set number of data lines per page when creating an Access report that is ultimately being used to export as a space-delimited text file? OR, is it possible to set a page break so that the exported space-delimited text file still contains the page break? I am trying to take an Access report and COLD (Computer Output to Laser Disk) process it into a document managment system. The only problem is, without...
0
1631
by: emebohw | last post by:
Hey all, weird problem. I cant seem to get a populated text field that has a hyperlink to work when I output my access report to MS office document image writer file. If I stick a 'label' type field on the report and put a url in there and print as msodiw then the hyperlink works. Anyone ever see this? Also, even on the access report, the hyperlink doesnt work correctly. WTH?
6
5219
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet. Again, I have this part working. But the fields in the resulting spreadsheet are in a different order than the Access report. (Example: The fields in the Access report might go FirstName, LastName,Address,City--in the Excel spreadsheet, they come up...
4
2948
akabir77
by: akabir77 | last post by:
Hi I am using the following code to convert a access report into HTML format and then sending it via email. DoCmd.SendObject _ acSendReport, _ "rptQC-Div-email", _ acFormatHTML, _ rs!email, _ , _
7
2957
by: KiwiGenie | last post by:
I have a form which lists selected records, there could be anything from 1 record to all records selected. I want to output a report for each record as HTML. I want each file to take its name from a certain field (RecipeName), so can't simply put a page break in the report. Would it be possible to create a loop which opens the report hidden, then exports it to HTML, then closes the report, and does this for each selected record? Or would all...
4
4811
tuxalot
by: tuxalot | last post by:
What is the best way to use a pdf file as the basis for a report? I have a Texas Work Comp. file that I would like to use as a report form. The original pdf fills an 8-1/2x11 page nicely within acrobat. However, when bringing the pdf into Access I am having issues with scaling. If I create an unbound object or simply drag and drop the pdf file into the design screen of my report, it scales much smaller that the original pdf. I've also tried...
0
7997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7929
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8409
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8065
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1526
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1266
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.