473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I find out if a report has been printed after pre-viewing

Hi,

I need to timestamp printed records with the printing date. According
to the customer's requests the report must be opened in preview-mode
and the user clicks on the printer button if he really want to have a
hardcopy.
The customer selects the records with a special selection form, where
he can combine up to appr. 20 different criterias, which are combined
to a more or less complex filter string. This string is then written
to the filter property of a form (where he can modify the records), to
the filter property of a report (which will be displayed in preview
mode) and to do the timestamp I copy the filter as WHERE part to a SQL
string which makes the update in the table. This works great, but I
could not find out how to get the information if the report has really
been printed.

Has anybody a good idea?

Oh yes, I use MS-Access XP

Thx Wolfgang
Nov 13 '05 #1
2 4559
On Sat, 26 Feb 2005 15:05:07 GMT, Wolfgang wrote:
Hi,

I need to timestamp printed records with the printing date. According
to the customer's requests the report must be opened in preview-mode
and the user clicks on the printer button if he really want to have a
hardcopy.
The customer selects the records with a special selection form, where
he can combine up to appr. 20 different criterias, which are combined
to a more or less complex filter string. This string is then written
to the filter property of a form (where he can modify the records), to
the filter property of a report (which will be displayed in preview
mode) and to do the timestamp I copy the filter as WHERE part to a SQL
string which makes the update in the table. This works great, but I
could not find out how to get the information if the report has really
been printed.

Has anybody a good idea?

Oh yes, I use MS-Access XP

Thx Wolfgang


While the below code will let you know when the report has been sent
to the printer, directly or after preview, there is no way to
guarantee that it has actually been successfully printed until you
have the paper report in your hand.

The actual starting value of intPreview depends upon if you have a
control in the report to compute [pages].

Option Compare Database
Option Explicit
Dim intPreview As Integer

Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is not used
' intPreview = -2 ' If [Pages] used
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview >= 0 Then ' If [Pages] not used
' If intPreview >= 1 Then ' If [Pages] used
MsgBox "Gone Printing"
End If
intPreview = intPreview + 1
End Sub

You can use it to do something only if the report is actually sent to
the printer, i.e. in the Report Footer Print event....

If intPreview = 0 Then
' do something here
End If
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
On Sat, 26 Feb 2005 17:03:12 GMT, fredg <fg******@example.invalid>
wrote:
On Sat, 26 Feb 2005 15:05:07 GMT, Wolfgang wrote:
Hi,

I need to timestamp printed records with the printing date. According
to the customer's requests the report must be opened in preview-mode
and the user clicks on the printer button if he really want to have a
hardcopy.
The customer selects the records with a special selection form, where
he can combine up to appr. 20 different criterias, which are combined
to a more or less complex filter string. This string is then written
to the filter property of a form (where he can modify the records), to
the filter property of a report (which will be displayed in preview
mode) and to do the timestamp I copy the filter as WHERE part to a SQL
string which makes the update in the table. This works great, but I
could not find out how to get the information if the report has really
been printed.

Has anybody a good idea?

Oh yes, I use MS-Access XP

Thx Wolfgang


While the below code will let you know when the report has been sent
to the printer, directly or after preview, there is no way to
guarantee that it has actually been successfully printed until you
have the paper report in your hand.

The actual starting value of intPreview depends upon if you have a
control in the report to compute [pages].

Option Compare Database
Option Explicit
Dim intPreview As Integer

Private Sub Report_Activate()
intPreview = -1 ' If [Pages] is not used
' intPreview = -2 ' If [Pages] used
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As
Integer)
If intPreview >= 0 Then ' If [Pages] not used
' If intPreview >= 1 Then ' If [Pages] used
MsgBox "Gone Printing"
End If
intPreview = intPreview + 1
End Sub

You can use it to do something only if the report is actually sent to
the printer, i.e. in the Report Footer Print event....

If intPreview = 0 Then
' do something here
End If


Thank you for the quick response and the sample code.
Wolfgang
Nov 13 '05 #3

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

Similar topics

1
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
0
by: Becky | last post by:
Hi: I have a main report that calls a sub-report which contains several pages of data. One of the column headings in my sub-report is called "Funds". If several records contain the same Fund...
0
by: BFord | last post by:
Using Acc2000, only the report itself not printing. The following have been tested, with no problem: 1) the print drivers are fine. 2) printed the query (source of the report) 3) printed...
8
by: Armando | last post by:
Here's one that's going to leave me bald before long - I have a report (no headers or footers, small detail section) that runs normally when I open it from the database window. When I run it...
5
by: bcanavan | last post by:
When I export xml(and xls) from Access 2003 the result is a complete report in a single page. I would like to get the entire report in a single page (one trip to the server) for printing and...
0
by: vitara | last post by:
I was hoping that someone possibly has a solution to my issue. When I print the form from crystal reports using my dot matrx printer on a pre-printed form, all the information is aligned properly. ...
1
by: adolph | last post by:
I have a problem with pages being printed out of order. An example is a 15 page duplexed report. Title page fine back of title page blank. (As it should be) SEcond page front, bottom says Page 1...
0
by: Patrick | last post by:
I am using Vb dot net 2003 with Crystal Report. I need to design a report to be printed on a pre-printed paper which size is 8.50" * 12". On the driver of the default printer, I created a new...
1
by: Ron | last post by:
Hi All, I'm using A2K and need to print a specific pre-printed form. I know that once I have that report on a particular computer screen I can select "Page Setup" and change the margins to get...
0
by: swaroopgadekar | last post by:
Please tell me how can i print the selected text matter of a crystal report in WINDOWS APPLICATION, on a pre printing stationary EX:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.