473,795 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert a page break in multi-page document?

Dear all,

For some reason, I have to write my own code to print a document instead of
using report writer. The source is an array with dynamic length. If one
page is full, I have to insert a page break and print a new page to
continue.

The following code segment is what I'm using right now. My question is how
to insert a page break in the middle of the loop since I don't find any
method in PrintDocument similar to this purpose.

Thanks for your attention and kindly help!

James

'>>> code segment
Private objPrintDoc As PrintDocument
Private arrData() As String

Private Shared Sub PrnSlip()
AddHandler objPrintDoc.Pri ntPage, AddressOf _PrnSlip

Call objPrintDoc.Pri nt()

RemoveHandler objPrintDoc.Pri ntPage, AddressOf _PrnSlip
End Sub

Private Shared Sub _PrnSlip(ByVal sender As Object, ByVal e As
PrintPageEventA rgs)
Dim strData As String

For Each strData In arrData
' loop the array arrData and print
' if page is full, make a page break here and continue
Next
End Sub
'>>>
Jan 19 '06 #1
1 5647
Hi James,

Based on my research, we need to calculate the printed content size and
handle the PrintPage event to Print out our content.
You can take a look at the sample in the MSDN link below.

PrintDocument.P rintPage Event
http://msdn2.microsoft.com/en-us/lib...ng.printdocume
nt.printpage.as px

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 19 '06 #2

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

Similar topics

4
7433
by: Lauren Quantrell | last post by:
I have created the following trigger: CREATE TRIGGER ON OutputTable FOR INSERT AS Declare @filename nvarchar(35) Declare @filecontents nvarchar(2000) Declare @strcmdshell varchar(150)
8
6299
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with one-to-one relationship but on this occasion I must keep username/password details within a seperate table. Here's the basic specs and database schema: -------------------------------------------
2
10108
by: Mardy | last post by:
Hello In my asp.net application, I'm trying to write a multi-line message to a label server control after a db insert. I'd like to force a line break at a particular point but I can't seem to find the magic words. Please help
7
8884
by: BrianDH | last post by:
String = “val1, val2, va3, va4” Insert value into col1 (String) I am looking for an example of an insert statement that parses a string with multi values separated by a comma. I want to parse these values and put one Value, per row, into the same column. Thanks BrianDH
2
3683
by: wombat53 | last post by:
Hi Group Are there any DB2 UDB ESE DPF V8.2 users exploiting "buffered inserts" (BIND parm INSERT BUF) *and* "multi-row INSERTS" (many rows associated with the VALUES clause of the INSERT to minimize number of calls to the RDMBS engine) in an SQL PL Stored Procedure? I ask, as the latter would imply embedded DYNAMIC SQL due to potentially varying number of rows to be inserted (assume it's varying), and so, the SQL INSERT would have be...
1
12063
by: Wes Groleau | last post by:
INSERT INTO X ...... ( A, B, C ) INSERT INTO Y ...... ( J, K, L ) If Y has a foreign key M which is the primary key D of X, is there an easy and/or efficient way to have SQL Server assign D, and tell us what it is so we can add M to the list for Y ? I know I can select D where A, B, C but I wondered about other tricks.
26
10222
by: Alexander Korsunsky | last post by:
Hi! I have some code that looks similar to this: -------------------------------------------- char array = "abcdefghij"; for (int i = 0; i < 10; i++) {
3
1906
by: assgar | last post by:
Hi I am having problem with my loping. I don't know if I have chosen the correct approach. GOAL: I need to insert into a table event types for a specific date range. The calendar the event type is displayed on is divided into 15 minutes time intervals
9
2723
by: sunita jadhav | last post by:
my question is if i type in html textbox on key press event suppose i type 12345 values in textbox then i delete or edit any value of text box suppose i edit 3 and i insert the value 6 at 3 but i have face problem that is if i insert 6 at 3 this value is not insert at 3 it insert last positon i.e after last value .In given example the value is appned or insert after 5 then output is 12456 but i have want the output 12645 and i also give the...
4
4185
by: LouiseR | last post by:
I just recently tried to use a multi-row insert on a table that contains a timestamp column, but I get SQLCODE -180 even though I'm positive that the value that I'm trying to insert is correct. The error message is : " THE DATE, TIME, OR TIMESTAMP VALUE *N IS INVALID". Any ideas?
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.