Click here to Skip to main content
15,877,637 members
Home / Discussions / C#
   

C#

 
AnswerRe: pop3 secure mail download using C# Pin
dan!sh 13-Sep-09 1:42
professional dan!sh 13-Sep-09 1:42 
GeneralRe: pop3 secure mail download using C# Pin
khosnur13-Sep-09 2:28
khosnur13-Sep-09 2:28 
GeneralRe: pop3 secure mail download using C# Pin
dan!sh 13-Sep-09 3:53
professional dan!sh 13-Sep-09 3:53 
QuestionRetreive Email & Attachments [modified] Pin
kdwarak13-Sep-09 0:16
kdwarak13-Sep-09 0:16 
AnswerRe: Retreive Email & Attachments Pin
Richard MacCutchan13-Sep-09 1:33
mveRichard MacCutchan13-Sep-09 1:33 
QuestionLoading Excel into sqlserver Pin
kdwarak12-Sep-09 23:37
kdwarak12-Sep-09 23:37 
AnswerRe: Loading Excel into sqlserver Pin
dan!sh 13-Sep-09 0:58
professional dan!sh 13-Sep-09 0:58 
QuestionPrintDoc PrintPreview problem with random numbers Pin
Hilary Jenkinson12-Sep-09 23:18
Hilary Jenkinson12-Sep-09 23:18 
I have an application which involves creating a set of randomly generated numbers that are included in the document to be printed.

Prior to printing I am displaying the document(s) in a PrintPreview form constructed with a PrintPreviewControl.
There is a button on the form which calls up a printer dialog and the document is then printed on ok click on the printer dialog after pages to print selection etc.

The problem I am having is that, to display the document in the PrintPreview form the random numbers are generated in the calling form and the printDoc_PrintPage function then formats the document using the random numbers that have been put in an array.

This is fine.

But when I click to print the document, the printDoc_PrintPage function is called again to generate the document for the printer but the array of random numbers is now cleared and so an error is thrown.

I could put the generation of the random numbers within the the printDoc_PrintPage function, but the output would then be different between the printPreview display and the printed paper document.

I don't want to have to pass the array back and forth between the forms.
The printPreview form is used for assorted documents in various places in the application and should be kept generic and should only need a printDocument.

Does anyone have any suggestions as to how I might get around this problem please?

I would think many people would like to have a 'completed' document to pass around but it seems that the only option is to create the document on the fly for each call to print.

I can't see how you can achieve this without persisting the document to a file.

I might be missing something simple here or misunderstanding how to use these components but I can't find any examples of similar use.

Thanks
AnswerRe: PrintDoc PrintPreview problem with random numbers Pin
OriginalGriff12-Sep-09 23:28
mveOriginalGriff12-Sep-09 23:28 
GeneralRe: PrintDoc PrintPreview problem with random numbers Pin
Hilary Jenkinson12-Sep-09 23:43
Hilary Jenkinson12-Sep-09 23:43 
GeneralRe: PrintDoc PrintPreview problem with random numbers Pin
OriginalGriff13-Sep-09 0:00
mveOriginalGriff13-Sep-09 0:00 
GeneralRe: PrintDoc PrintPreview problem with random numbers Pin
Hilary Jenkinson13-Sep-09 0:46
Hilary Jenkinson13-Sep-09 0:46 
QuestionAbout POS system made in C# Pin
CoderForEver12-Sep-09 21:46
CoderForEver12-Sep-09 21:46 
AnswerRe: About POS system made in C# Pin
Richard MacCutchan12-Sep-09 22:21
mveRichard MacCutchan12-Sep-09 22:21 
GeneralRe: About POS system made in C# Pin
CoderForEver13-Sep-09 0:35
CoderForEver13-Sep-09 0:35 
AnswerRe: About POS system made in C# Pin
OriginalGriff12-Sep-09 22:51
mveOriginalGriff12-Sep-09 22:51 
GeneralRe: About POS system made in C# Pin
CoderForEver13-Sep-09 0:27
CoderForEver13-Sep-09 0:27 
GeneralRe: About POS system made in C# Pin
OriginalGriff13-Sep-09 0:48
mveOriginalGriff13-Sep-09 0:48 
GeneralRe: About POS system made in C# Pin
CoderForEver13-Sep-09 0:57
CoderForEver13-Sep-09 0:57 
GeneralRe: About POS system made in C# Pin
OriginalGriff13-Sep-09 1:15
mveOriginalGriff13-Sep-09 1:15 
GeneralRe: About POS system made in C# Pin
CoderForEver14-Sep-09 21:56
CoderForEver14-Sep-09 21:56 
AnswerRe: About POS system made in C# Pin
Dave Kreskowiak13-Sep-09 4:25
mveDave Kreskowiak13-Sep-09 4:25 
GeneralRe: About POS system made in C# Pin
CoderForEver14-Sep-09 21:53
CoderForEver14-Sep-09 21:53 
Questionhelp in tab control Pin
michaelgr112-Sep-09 20:44
michaelgr112-Sep-09 20:44 
AnswerRe: help in tab control Pin
zafersavas12-Sep-09 21:56
zafersavas12-Sep-09 21:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.