Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old November 4th, 2003, 09:14 AM
kathelene kathelene is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: malaysia
Posts: 1 kathelene User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question printing and updating

Is there an event I can call that will activate when I click File, Print on a report in print preview mode?

There is onPrint event on the Detail, but it comes up whenever I open the report. I want to run some VB code when a person tries to send the report to the printer.

Basically I have a report which prints specific data. I only want this report printed once for the range of data specified. The VB code will save what has been printed and then check this saved data against all future reports to make sure nothing is duplicated on the printer.

Reply With Quote
  #2  
Old November 4th, 2003, 08:25 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via MSN to cleverpig
Which vb version do u use??If u use vb.net,plz see this:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Event delagation HasOverloaded.OnPrint to OnPrint
AddHandler HasOverloaded.OnPrint, AddressOf OnPrint
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Calling shared print method of HasOverloaded
HasOverloaded.Print("There is no pleasure without Pain")

End Sub

Private Sub OnPrint(ByVal value As Object)
'On Print procedure
Text = "OnPrint : " & value
End Sub


End Class

Public Class HasOverloaded
'Event declaration
Public Shared Event OnPrint(ByVal Value As Object)

'overloaded methods Print event will be raise to notify calling
'application back through event delegation
Overloads Shared Sub Print(ByVal str As String)
RaiseEvent OnPrint(str)
Debug.WriteLine(str)
End Sub
Overloads Shared Sub Print(ByVal ch As Char)
RaiseEvent OnPrint(ch)
Debug.WriteLine(ch)
End Sub
Overloads Shared Sub Print(ByVal ALong As Long)
RaiseEvent OnPrint(ALong)
Debug.WriteLine(ALong)
End Sub
Overloads Shared Sub Print(ByVal Int As Integer)
RaiseEvent OnPrint(Int)
Debug.WriteLine(Int)
End Sub

End Class

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > printing and updating


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway