Solved

PrintPreviewDialog Prints Blank Pages

Posted on 2007-11-26
1
711 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

621 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