Solved

PrintPreviewDialog Prints Blank Pages

Posted on 2007-11-26
1
697 Views
Last Modified: 2013-12-16
C#.Net 2005
Visual Studio 2005 Pro

We are developing a form that prints generated values.  When we use this code _pd.Print(); the report prints perfectly, and when we use this code:

PrintPreviewDialog ppd = new PrintPreviewDialog();
            ppd.Document = _pd;
            ppd.ShowDialog();

the preview is perfect, but only a few lines print when the user click print.

And thats the problem.
0
Comment
Question by:bmiller250
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 500 total points
ID: 20352692
Let me make sure I understand this:
   If you print without previewing, it's correct.
   If you preview it's correct.
   If you preview and then print it's wrong.

Can I also assume that the same code runs (the print_page event) regardless of which case you use?  If that's the case, the problem is probably that something isn't being reset correctly in your print_page code, so when you print after previewing the code thinks it's already done.  You probably have variables to track what page you're on or where you are at in the document that persist between pages.  At least one variable like this is not reset correctly.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question