Printing Document using print preview control...

S

sachin

Hi

I am working on report using print preview dialog control in
windows application. Report is displayed properly in control. With
paper size 850X1350 (Legal)(Lanscape mode=true) .

But when page goes to printer for printing. It consider it as A4 size.
and truncate printing document.

any body help me...
 
K

Kevin Spencer

Did you set the Document in the PrintPreviewDialog? The PrintDocument has
the PrinterSettings and PageSettings that are used by the
PrintPreviewControl.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.
 
S

sachin

Hi kevin,
the code that i am using as follows


printDocument.DefaultPageSettings.PrinterSettings.DefaultPageSettings.Landscape=true;
printDocument.DefaultPageSettings.PrinterSettings.DefaultPageSettings.Margins.Left=25;
printDocument.DefaultPageSettings.PrinterSettings.DefaultPageSettings.Margins.Right
=50;
printDocument.DefaultPageSettings.PrinterSettings.DefaultPageSettings.Margins.Top
=20;
printDocument.DefaultPageSettings.PrinterSettings.DefaultPageSettings.Margins.Bottom=25;
 
S

sachin

hi kevin,

the same think I did for A4 size reports it works
fine...and gives good printouts ..

my problem is report is of size 850 X 1350 (Landscape) .. report is
showing in printpreview dialog control. But when i forwarded to printer
to print it truncats the printing text horizontaly...so any solution on
this..
 
K

Kevin Spencer

Hi sachin,

What I asked was, did you set the Document property of the
PrintPreviewDialog instance you're using to the PrintDocument that you
defined below? The PrintPreviewDialog class has a Document property that
determines where it gets its PageSettings and PrinterSettings from. If you
do not set it, it will use default PageSettings and PrinterSettings, rather
than the same PageSettings and PrinterSettings that you have configured for
your PrintDocument.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Who is Mighty Abbott? A twin-turret scalawag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top