473,386 Members | 1,997 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,386 software developers and data experts.

Printing on a new page

I want to take a new page while running over a resultset.
I made a very simple sample, i want to take a new page in "Afdrukken"
It's easy to say test on 14000 and don't test in "Afdrukken" but this is
only a simple sample, don't change the code, I really need a pagebreak in
"Afdrukken"

Thanks in advance

Here is the code

Dim afdruk As New SDCNetAfdrukDLL.clsAfdrukDLL
Dim i As Integer
Dim pry As Long
Dim strSQL As String
Dim rs As New FBZNETDataObject.FBZNETData
Dim bReturn As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Button1.Click
PrintDoc = New Printing.PrintDocument
strSQL = "SELECT Volgnr, Opmerking, ToegewezenAan, DatumOpl " _
& " FROM Taak "
bReturn = rs.lezen(strSQL)
PrintDoc.Print()
End Sub
Private Sub PrintDoc_PrintPage(ByVal sender As Object, ByVal e As

System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDoc.PrintPage
afdruk.pageEvents = e
'Running over resultset
Do While Not rs.EOF
Afdrukken()
'Take a new page when 15000 twips
If pry 15000 Then
e.HasMorePages = True
pry = 500
Exit Sub
End If
bReturn = rs.Volgende
Loop
e.HasMorePages = False
End Sub

Private Sub Afdrukken()
afdruk.Tekst(500, pry, rs.Waarde("Volgnr"))
pry = pry + 500
afdruk.Tekst(500, pry, rs.Waarde("opmerking"))
pry = pry + 500
'Take a new page when 15000
If pry 15000 Then
'Here i want a pagebreak !!!!!
End If
afdruk.Tekst(500, pry, rs.Waarde("ToegewezenAan"))
pry = pry + 500
afdruk.Tekst(500, pry, rs.Waarde("DatumOpl"))
pry = pry + 500
End Sub

Aug 3 '06 #1
1 1891
JR
Hoi,

In Uw afdrukroutine moet je ergens bijhouden hoever je bent gekomen met een
static variabele. dan stel je newpage op true (e.HasMorePages = True)

Dan verlaat je je routine want zodra je
e.HasMorePages = True bekomt kom je vanzelf opnieuw in dezelfde routine.
waar je volgens de static variabele verder afdrukt

Jan
"Zimba" <Zi***@discussions.microsoft.comschreef in bericht
news:A0**********************************@microsof t.com...
>I want to take a new page while running over a resultset.
I made a very simple sample, i want to take a new page in "Afdrukken"
It's easy to say test on 14000 and don't test in "Afdrukken" but this is
only a simple sample, don't change the code, I really need a pagebreak in
"Afdrukken"

Thanks in advance

Here is the code

Dim afdruk As New SDCNetAfdrukDLL.clsAfdrukDLL
Dim i As Integer
Dim pry As Long
Dim strSQL As String
Dim rs As New FBZNETDataObject.FBZNETData
Dim bReturn As Boolean
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Button1.Click
PrintDoc = New Printing.PrintDocument
strSQL = "SELECT Volgnr, Opmerking, ToegewezenAan, DatumOpl " _
& " FROM Taak "
bReturn = rs.lezen(strSQL)
PrintDoc.Print()
End Sub
Private Sub PrintDoc_PrintPage(ByVal sender As Object, ByVal e As

System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDoc.PrintPage
afdruk.pageEvents = e
'Running over resultset
Do While Not rs.EOF
Afdrukken()
'Take a new page when 15000 twips
If pry 15000 Then
e.HasMorePages = True
pry = 500
Exit Sub
End If
bReturn = rs.Volgende
Loop
e.HasMorePages = False
End Sub

Private Sub Afdrukken()
afdruk.Tekst(500, pry, rs.Waarde("Volgnr"))
pry = pry + 500
afdruk.Tekst(500, pry, rs.Waarde("opmerking"))
pry = pry + 500
'Take a new page when 15000
If pry 15000 Then
'Here i want a pagebreak !!!!!
End If
afdruk.Tekst(500, pry, rs.Waarde("ToegewezenAan"))
pry = pry + 500
afdruk.Tekst(500, pry, rs.Waarde("DatumOpl"))
pry = pry + 500
End Sub

Aug 3 '06 #2

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
5
by: Patrick De Ridder | last post by:
How can I turn what I want to print 90 degrees using the logic below? Please tell me the code with which to make the modification. Many thanks, Patrick. using System.ComponentModel; using...
0
by: Nigel | last post by:
I successfully create a .NET Component (Visual Basic .NET) that would print, unfortunately when used within a web browser it appears that .NET security doesn't allow you to run code that interacts...
4
by: Rob T | last post by:
I have a small VB program that has a printing module...very simple....and works great. However, If I try to print to a generic printer, I get the following error: "The data area passed to a...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: dotnet2005 | last post by:
Hi Toall , I want to explain you clearly , I am having some panels having some controls CheckBox,ComboBox,Datagridview,Hyperlink,label,Listbox,Picturebox,RadioButt­ on ,Textbox)...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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...
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...

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.