473,508 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I increment or create an array of PrintDocuments?

Can I do it like this?

buttonClick....
pe.PrintReport(@"\\WEB1\Shipping1");
pe.PrintReport2(@"\\WEB1\Shipping1");
pe.printCombinedDocuments(Class1.currentdoc);
}
Class1
{
public static PrintDocument allDocs = new PrintDocument();
public static PrintDocument currentdoc = new PrintDocument();
public static PrintDocument pd = new PrintDocument();
public static PrintDocument pd2 = new PrintDocument();
public static PrintDocument pd3 = new PrintDocument();

}

public bool PrintReport(string printerName)
{
public static PrintDocument pd = new PrintDocument();
PrinterSettings printerSettings = new PrinterSettings();
pd.PrinterSettings = printerSettings;
/////The following is the increment
Class1.allDocs[Class1.currentDoc] = Class1.pd;
Class1.currentDoc++;

}

public bool PrintReport2(string printerName)
{
public static PrintDocument pd = new PrintDocument();
PrinterSettings printerSettings = new PrinterSettings();
pd.PrinterSettings = printerSettings;
/////The following is the increment
Class1.allDocs[Class1.currentDoc] = Class1.pd2;
Class1.currentDoc++;

}

public bool PrintReport3(string printerName)
{
public static PrintDocument pd = new PrintDocument();
PrinterSettings printerSettings = new PrinterSettings();
pd.PrinterSettings = printerSettings;
/////The following is the increment
Class1.allDocs[Class1.currentDoc] = Class1.pd3;
/// Don't need to incrememt this any longer:
Class1.currentDoc++;

}

public bool printCombinedDocuments(int currentdoc)
{
public bool printCombinedDocuments(int currentdoc)
{
try
{
Class1.allDocs.Print();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
// Clean up goes here.
}
return true;
}
}

Any help is appreciated,
Thanks,
Trint

Nov 16 '05 #1
0 1100

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

Similar topics

2
16713
by: deko | last post by:
I need to populate a file with past unix time stamps over a period of time specified by the user. The time stamps should be evenly spaced, based on user-defined parameters. My question is: How...
1
5948
by: Hendrix | last post by:
Hi, I would like to pick four elements from a multidemensional array and use the content of those elements. I want to do this without all the subscript calls required for individual access, just...
31
2333
by: Anjali M | last post by:
#include <stdio.h> int main() { int number = 10; printf("Number is: %d\n", number); printf("Sizeof of number is: %d\n", sizeof(number++)); printf("Number now is: %d\n", number);
15
2657
by: ranjeet.gupta | last post by:
Dear All, Which is correct ? Let suppose we allocate the memory for the 100 bytes, int *PtrMemoryBlock = (int *)malloc(100); If I do
24
8131
by: trint | last post by:
add them into one PrintDocument: PrintDocument pd1 = new PrintDocument(); PrintDocument pd2 = new PrintDocument(); PrintDocument pdCombined = new PrintDocument(); pdCombined = pd1 + pd2;...
45
4048
by: Robbie Hatley | last post by:
Hello, group. I've been doing too much C++ programming lately, and I'm starting to become rusty at some aspects of the C way of doing things, esp. efficient low-level data copies. ...
2
5930
by: Nishu | last post by:
Hi All, My Aim here is to increment lArray whether control goes inside if statement or not. Is this a portable step and C guarantees that lArray must be incremented? Thanks, Nishu
0
4434
chumlyumly
by: chumlyumly | last post by:
Hello scripters - OS: Mac OSX Language: PHP w/ MySQL database I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
2
2270
by: braton | last post by:
Hello I'm wondering about the following thing: Let's define variable and set a pointer to points to it: int a = 0; int * p_a = &a; Now, according to C99, clause 6.5.6.7 I can treat...
0
7124
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
7326
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,...
0
7385
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...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
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...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
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...
0
1558
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 ...

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.