Need some help with printing....

D

Drygast

Newbie, so keep that in mind please ;-)
I need to check wheter the page I want to print should be printed on 1, 2 or
more pages but I don't no how...
The code looks as this:

----------------------------------------------------------------------------
----------------------------------------
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As
System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
If chkMalmo.Checked Then
e.Graphics.DrawString(("FÖLJESEDEL: " & Now.Year &
Microsoft.VisualBasic.Format(Val(Now.Month), "00") &
Microsoft.VisualBasic.Format(Val(Now.Day), "00") & " - Malmö"), New
Font("Arial", 16, FontStyle.Bold), Brushes.Black, 125, 25)
ElseIf chkSkarholmen.Checked Then
e.Graphics.DrawString(("FÖLJESEDEL: " & Now.Year &
Microsoft.VisualBasic.Format(Val(Now.Month), "00") &
Microsoft.VisualBasic.Format(Val(Now.Day), "00") & " - Skärholmen"), New
Font("Arial", 16, FontStyle.Bold), Brushes.Black, 125, 25)
ElseIf chkAnge.Checked Then
e.Graphics.DrawString(("FÖLJESEDEL: " & Now.Year &
Microsoft.VisualBasic.Format(Val(Now.Month), "00") &
Microsoft.VisualBasic.Format(Val(Now.Day), "00") & " - Ånge"), New
Font("Arial", 16, FontStyle.Bold), Brushes.Black, 125, 25)
End If

e.Graphics.DrawString(("Butik: "), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 50, 75)
e.Graphics.DrawString((af), New Font("Arial", 8, FontStyle.Bold),
Brushes.Black, 50, 100)

e.Graphics.DrawString(("Order: "), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 115, 75)
e.Graphics.DrawString((aa), New Font("Arial", 8, FontStyle.Regular),
Brushes.Black, 115, 100)

e.Graphics.DrawString(("In: "), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 190, 75)
e.Graphics.DrawString((ab), New Font("Arial", 8, FontStyle.Regular),
Brushes.Black, 190, 100)

e.Graphics.DrawString(("Ut: "), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 265, 75)
e.Graphics.DrawString((ac), New Font("Arial", 8, FontStyle.Regular),
Brushes.Black, 265, 100)

e.Graphics.DrawString(("Åtgärd: "), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 340, 75)
e.Graphics.DrawString((ad), New Font("Arial", 8, FontStyle.Regular),
Brushes.Black, 340, 100)

e.Graphics.DrawString(("Summa"), New Font("Arial", 8,
FontStyle.Bold), Brushes.Black, 700, 75)
e.Graphics.DrawString((ae), New Font("Arial", 8, FontStyle.Regular),
Brushes.Black, 700, 100)

e.Graphics.DrawString(("Totalt"), New Font("Arial", 12,
FontStyle.Bold), Brushes.Black, 650, 999)
e.Graphics.DrawString((lblTotalSumma.Text), New Font("Arial", 12,
FontStyle.Bold), Brushes.Black, 715, 999)
End Sub
----------------------------------------------------------------------------
----------------------------------------

What I need to check is if any of th strings (af, aa, ab,ac and so on)
contains more rows than fits a single paper and if so split into multiple
pages.
Is it possible at all? I have the same information in a listview, but I have
no clue on how to print a listview on multiple pages (or on a single page
for that matter ;-) )

Regards
/Nicke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top