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

how to add multiple pages in print

hello sir,

please help me ,how to add multiple pages in print.i have sent my coding also
pls help me....................




Expand|Select|Wrap|Line Numbers
  1. Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
  2.         Try
  3.             Dim first, second, third, boundary, head, content, content1, content2, content3, contboun, bottom As String
  4.             Dim i, y As Integer
  5.             Dim font As New Font("Arial", 16, FontStyle.Bold)
  6.             Dim font1 As New Font("Arial", 14)
  7.             Dim rowcount As Integer = 2
  8.             ' If (Directory.Exists("print\print")) Then
  9.             ' Dim filename As String = "print\print"
  10.             ' Dim myfilestream As New System.IO.FileStream(filename, FileMode.Open, FileAccess.ReadWrite)
  11.             ' Dim temp As New System.IO.StreamReader(myfilestream)
  12.             ' no = CInt(temp.ReadLine())
  13.             ' temp.Close()
  14.             ' myfilestream.Close()
  15.             ' End If
  16.             'Dim pageWidth As Integer
  17.             'With PrintDocument1.DefaultPageSettings
  18.             '    pageWidth = .PaperSize.Width - .Margins.Left - .Margins.Right
  19.             'End With
  20.             first = "TAMILNADU STATE TRANSPORT CORPORATION LTD.,TIRUNELVELI."
  21.             e.Graphics.DrawString(first, font, Brushes.Black, 250, 100)
  22.             second = "ISSUE DETAILS"
  23.             e.Graphics.DrawString(second, font, Brushes.Black, 500, 140)
  24.             third = "Vehicle No/Unit No :  " + ListView1.Items(0).SubItems(0).Text + "               Date :" + received + "                                    No:   " + no.ToString
  25.             e.Graphics.DrawString(third, font, Brushes.Black, 100, 180)
  26.             boundary = "==================================="
  27.             contboun = "----------------------------------------------"
  28.             bottom = "     Prepared By                                                                                          Workshop In_Charge                 "
  29.             e.Graphics.DrawString(boundary, font, Brushes.Black, 100, 220)
  30.             head = "Item Code                                    Item_Name                                      Qty                          Value"
  31.             e.Graphics.DrawString(head, font, Brushes.Black, 100, 260)
  32.             e.Graphics.DrawString(boundary, font, Brushes.Black, 100, 300)
  33.             content = ""
  34.             y = 330
  35.             For i = 0 To ListView1.Items.Count - 1
  36.                 content = ListView1.Items(i).SubItems(1).Text + "          "
  37.                 content1 = ListView1.Items(i).SubItems(5).Text + "          "
  38.                 content2 = ListView1.Items(i).SubItems(3).Text + "          "
  39.                 content3 = ListView1.Items(i).SubItems(6).Text + "          "
  40.                 e.Graphics.DrawString(content, font1, Brushes.Black, 120, y)
  41.                 e.Graphics.DrawString(content1, font1, Brushes.Black, 280, y)
  42.                 e.Graphics.DrawString(content2, font1, Brushes.Black, 820, y)
  43.                 e.Graphics.DrawString(content3, font1, Brushes.Black, 1020, y)
  44.                 e.Graphics.DrawString(contboun, font1, Brushes.Black, 100, y + 20)
  45.                 content = ""
  46.                 y += 60
  47.                 rowcount += 2
  48.                 If rowcount > 25 Then
  49.                     e.HasMorePages = True
  50.                     rowcount = 2
  51.                 Else
  52.                     e.HasMorePages = False
  53.                 End If
  54.             Next
  55.         Catch ex As Exception
  56.             MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
  57.         End Try
  58.     End Sub
May 18 '10 #1
0 952

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
24
by: Andy Sutorius | last post by:
Has anyone successfully created a Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
2
by: bissatch | last post by:
Hi, I am trying to use JavaScript to write a table column on a web page. The code is as follows: <html> <head> <script> function displaycount() {
5
by: Daniel Crespo | last post by:
Is there a built-in method for transforming (1,None,"Hello!") to 1,None,"Hello!"? Thanks
10
by: fei.liu | last post by:
Consider the following sample code char * ptr = "hello"; char carray = "hello"; int main(void){ } What does the standard have to say about the storage requirement about ptr and carray? Is...
4
by: arnuld | last post by:
i am learning C and doing the exercise 1-1 of K&R2, where K&R ask to remove some parts of programme and experiment with error, so here i go: #include <stdio.h> int main () { printf('hello...
1
by: James T. Dennis | last post by:
You'd think that using things like gettext would be easy. Superficially it seems well documented in the Library Reference(*). However, it can be surprisingly difficult to get the external details...
0
by: devito | last post by:
hi there, for some days i try to build the boost.python tutorial "hello world" without bjam on winxp by using mingw. so i wrote a *.bat-file like the following: // --- snip...
0
Nepomuk
by: Nepomuk | last post by:
Hi everybody! As was suggested here, today should be Hello World Day! So, here's my Hello World Program in bash script: #!/bin/bash i=0; function hello { case $i in 0) echo 'H' i=`expr...
0
by: tosreejithp | last post by:
Hi, My first problem was i am not able to compiled a file from java script to java class.Now its clear and working fine..now i can convert a java script file to java class by Rhino Java Script...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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: 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?

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.