Hi everybody,
When i try to print some file with a Print Dialog, i don't have any problem, and my control is printed exactly as i want.
But, when i use a PrintPreview Dialog, the pages seem to be good on the print preview, but when i try to print with the given control of PrintPreviewDlg, i only get a white page getting out my print...
Does anyone have a solution
Thanks to everyone : )

PrintPreview problem
Asj2005
Hello Ours,
I have the same problem ... :-(
My english is not very good but I have read that you have resolve the problem.
Can you give me more explanations
Thanks a lot
Jacques
LeeRyder
Well... no.
I got this box when i'm using the printdialog methode... But, when i'm using the PrintPreviewDialog, there is a button on the default forme, with a printer.
I don't have any problem when i want to print using the normal way, my dialogs are good and well setted. But when i want to use the PrintPreviewDialog, and click on the button, i directly go to the printer, with no more dialog, and have a white page.
Maybe if i know how to catch the click on the implemented button (the one made by microsoft in the prinpreviewdialog class :)), i could get what's really happens..
It's hard to explain exactly, but i hope you've understand
Daftan
So, i get the answer.
When the printpreview dialog is called, my sub to draw my pages is called a first time(by the print event). I assumed that the printpreview will not recall it a second time, and keep in memory. But in fact, the print event is raised a second time, and i get shared objects.. So, my vars weren't initialized at new, and my function failed.
Thanks for your help :)
kostasT
markello
ok here is a silly "check" point - is there ink I remember I had someone go through this, and after days found out he had no ink *oops*
Just to add - have you tried saving the print to a file instead of directing it to a printer That will then show you is perhaps you have set the wrong document to print property
sraju
I guess that if I could print a page using the print dialog, there is enough ink in my printer.. : )
Thanks, but i think that the problem is coming from another thing...
added : Dunno how do that.. maybe can you give an exemple to do this, or how todo this print normaly here is my code for printpreview :
Public Sub PrintPreview(ByVal objectToPrint As Object, ByVal projectName As String)
Try
PrintPreviewDialog1.Document = GetPrintDocument(objectToPrint, projectName)
PrintPreviewDialog1.ShowDialog()
Catch e As InvalidPrinterException
MsgBox(m_ResourceManager.GetString("Msg.Text.PrintPreview"), MsgBoxStyle.Exclamation, DataManagementLibrary.SgsTitle)
PrintPreviewDialog1.Close()
End Try
End Sub
GetPrintDocuments return the good print document (I use the same function for normal print, and the printpreview is good.. only the real print when i go through this control fails..)
jklcom
well when you write to a file - when you click "print" you will get the print dialog box right
Well, find a check box which says "print to file" and click ok, so it will print the document to the file on disk rather than to the printer