473,386 Members | 1,867 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.

hasmorepages

Hello
I have a problem with printing data from dataset.I dont know how to
make that print is go on to the next page.
I know that is something with hasmorepages = true but i dont Know how
to use it.

Here is my code, so every help is greatful.

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage

Dim i As Integer = 0
Dim c As Integer = 100
Dim a As Integer = 0
While i < Form1.Ds.Tables(0).Rows.Count - 1

Dim row0 As String
=Form1.Ds.Tables(0).Rows(i).Item("Datum").ToString
e.Graphics.DrawString(row0,
FontDialog1.Font,Brushes.Black, 100, c)
Dim row1 As String
=Form1.Ds.Tables(0).Rows(i).Item("Stranka").ToStri ng
e.Graphics.DrawString(row1,
FontDialog1.Font,Brushes.Black, 200, c)
Dim row2 As String
=Form1.Ds.Tables(0).Rows(i).Item("Adresa stranke").ToString
e.Graphics.DrawString(row2,
FontDialog1.Font,Brushes.Black, 350, c)
Dim row3 As String =
Form1.Ds.Tables(0).Rows(i).Item("Brojnaloga").ToSt ring
e.Graphics.DrawString(row3,
FontDialog1.Font,Brushes.Black, 650, c)
Dim row4 As String
=Form1.Ds.Tables(0).Rows(i).Item("Pocetno stanje").ToString
e.Graphics.DrawString(row4,
FontDialog1.Font,Brushes.Black, 750, c)
Dim row5 As String
=Form1.Ds.Tables(0).Rows(i).Item("Zavrsno stanje").ToString
e.Graphics.DrawString(row5,
FontDialog1.Font,Brushes.Black, 850, c)
Dim row6 As String
=Form1.Ds.Tables(0).Rows(i).Item("Km").ToString
e.Graphics.DrawString(row6,
FontDialog1.Font,Brushes.Black, 950, c)

Dim blackPencrta2 As New Pen(Color.Black, 1)

Dim point31 As New Point(90, c + 20)
Dim point32 As New Point(1050, c + 20)
' Draw line to screen.
e.Graphics.DrawLine(blackPencrta2, point31, point32)
e.Graphics.DrawLine(blackPencrta2, 90, 50, 90, c + 20)
e.Graphics.DrawLine(blackPencrta2, 190, 50, 190, c + 20)
e.Graphics.DrawLine(blackPencrta2, 340, 50, 340, c + 20)
e.Graphics.DrawLine(blackPencrta2, 640, 50, 640, c + 20)
e.Graphics.DrawLine(blackPencrta2, 740, 50, 740, c + 20)
e.Graphics.DrawLine(blackPencrta2, 840, 50, 840, c + 20)
e.Graphics.DrawLine(blackPencrta2, 940, 50, 940, c + 20)
e.Graphics.DrawLine(blackPencrta2, 1050, 50, 1050, c + 20)
i = i + 1
c = c + 20
a = a + 1

If a = 33 Then
e.HasMorePages = True
c = 100
a = 0
Else
e.HasMorePages = False
End If

End While

end sub

Feb 15 '07 #1
0 1548

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

Similar topics

8
by: Mr. B | last post by:
VB.net (standard) I'm experiencing some difficulties in printing multiple pages using Print Preview. The following is my main parts of my printing subs (excess info deleted for your viewing...
3
by: DGeorge | last post by:
I have a problem where after setting the HasMorePages = True will not print the 2nd Pages. Does anybody have an idea or knows this problem. Thanks for any advice
1
by: Kyle Walz | last post by:
I'm working on an app where each page is a like a form (not Windows form) with a set format. Using MSVB.NET 2003 with 1.1 framework. Here's some code: Private Sub PrintText(ByVal sender As...
1
by: Brenton Garman | last post by:
hello all..... I can currently print out only one page with the following code...(note it lacks the e.hasmorepages=false) Private Sub PrintToolStripButton_Click(ByVal sender As System.Object,...
2
by: Leo | last post by:
I set HasMorePages to true, but it doesn't let me jump to next page. (Of course, if I remove the HasMorePages = false in my if statement, it will create hundreds of pages). Any suggestion? Thanks...
1
by: kig25 | last post by:
Hello, When using the VB.NET PrintDocument class, I seem to be encountering an issue where the sub pd_PrintPage handles PrintDocument.PrintPage (upon continuing if HasMorePages = true) will...
6
by: moti | last post by:
Whenever I use PrintDocument.Print() to print a page it goes to PrintDocument_PrintPage and stays there forever unless I set e.HasMorePages to False. When I set it to False it prints the page but...
0
by: Scotty | last post by:
Hi, Hope someone can help me I have a datagridview sith data Code below works fine if I print the data if there is only 1 page (without using '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! If...
2
by: GGSoft | last post by:
Please Can't understand how to use HasMorepages. I spent a lot of time on this task. but I have no result. For examle I want to print every 45 record on each new page. Please Rewrite the...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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.