?
Solved

How to capture a document sent to a specific printer

Posted on 2011-10-14
9
Medium Priority
?
370 Views
Last Modified: 2014-02-08
I need to capture and save (into a database table) a document, sent to a specific printer on a network.  The document is an ms - access report. Thanks in advance.
0
Comment
Question by:HARRY222
7 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 500 total points
ID: 36968666
I don't really get what you are after here.

An Access report has no 'existance' outside of the source Access database.  It is an internal object.

You can export your report as a pdf, say, and store that, but it would be separate action to the report being printed.
 
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36968693
it maybe possible if you control the viewing and printing of reports using a form.

 give more info...
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1000 total points
ID: 36969445
You have a couple of options:

1. Don't "print" to a printer, but have it output directly to a file in PDF format.

2. Setup a printer that prints to a file, then convert to PDF using something like Ghost Script.  Or you can leave it as it and store it, but then you can only send it to a printer that will understand the file (ie. you used a post script driver)

  But there is no way really to intercept output to a standard printer and then re-direct it into the database.

Jim.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36970042
<No Points wanted>

What you seem to be needing here is a "Snapshot" of the report.

In the old days, you would have created a "Snapshot File".

As Pete stated, PDF's are commonly used for this now...
If you are using Access 2007 or newer this is easy (with Access 2007 you have to install the PDF add-in)

Try putting code like this on your "Print" button:

Dim strReportName As String
strReportName = "rptSortYear"
'Print the Report
DoCmd.OpenReport strReportName
'Save the report as a PDF
DoCmd.OutputTo acOutputReport, strReportName, acFormatPDF, "C:\YourFolder\" & strReportName & ".pdf"
'Optional, Close the report
'DoCmd.Close acReport, strReportName

If you are using a version of Access prior to 2007 this will require an intermediate step (calling the code to create the PDF) but the principal will be the same...

Keep us posted...

;-)

JeffCoachman
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 500 total points
ID: 36970871
oops...

I misread your request
<I need to capture and save (into a database table) a document, >
Can you state your reasoning behind this request...?

If you save a copy of a report each time it is printed, you will have many duplicates...
Even if they all had different filters applied, how are you planning on managing the different names?
Suppose the report is printed once a day?  At the end if the year you will end up with around 270 reports stored in the DB!...

Also note that these will all be "Snapshots", so they won't include the most recent data, (unless you Print/Save the report again), so again, whats the reason for wanting to "store" it?
Finally how would you go about "Retrieving" these reports?

It is just hard to imagine why you would want to save a copy of the same report to the DB every time it is printed...

Remember that reports can be filtered, so you can "View" a filtered report anytime you want without saving it.

If you truly need a "Snapshot", then you will have to be using Access 2007 or newer and create a table with at least one Record to store all of the reports.
You would have to save the DB in the 2007 format (.accdb) and create a field in the table with a Datatype of "Attachment", then use some fairly complex code to store each printed report into this field...

But again, I just would like to know what your ultimate here need is...?

JeffCoachman
0
 

Author Comment

by:HARRY222
ID: 36973942
Thanks for reply. I'll try to explain. For every page than i print from my ms-access report there is a "blind box" -between my PC and printer - that adds to my printed page a text line. This line is different for every page i print. I need to capture my printed page with text line and to store it into a database with an ID.
I want to do that in order to print later the stored page (as a copy) with the text line. Thanks in advance.
0
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 1000 total points
ID: 36974033
<<Thanks for reply. I'll try to explain. For every page than i print from my ms-access report there is a "blind box" -between my PC and printer - that adds to my printed page a text line. This line is different for every page i print. I need to capture my printed page with text line and to store it into a database with an ID.
I want to do that in order to print later the stored page (as a copy) with the text line. Thanks in advance. >>

  I think your only option is to have the printer driver set as "print to file".  Doing that spools the output into a file.  One "printed", you can take the file and store it by labeling it in a certain way (ie.  "PO_<file ID>.prn") and record the ID.  

  To get the output, you'd then do a binary file copy of the file to the real printer port.  You could do that as many times as needed, but the physical printer would need to match the driver you intially used for it to understand the file.

  I use this technique with label files, which I produce locally in the client system, then transmitt to the shipping warehouse.  Warehouse personel then send the files to the thermal printer as needed.

Jim.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

Lost Word File? Eagerly, need it back? Read ahead; this File Recovery guide is for you.
Currently, there is an issue with being able to copy values from an external application to a dropdown list in Project Web Access (PWA).  The standard copy and paste methods don't seem to work properly. Here is a way to accomplish this task to s…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

807 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