Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Printing in Vista (Read 4197 times)
Oskar
YaBB Newbies
*
Offline


I like YaBB 1G - SP1!

Posts: 21
Joined: Nov 28th, 2008
Printing in Vista
May 6th, 2009 at 12:46pm
Print Post  
We have problem printing in Windows Vista. When using DiagramView.Print() nothing happens. Are the any special print options that are needed?
It is still possible to print the document from PrintPreviw and PrintPreviewEx and in XP everything works perfectly.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing in Vista
Reply #1 - May 6th, 2009 at 2:00pm
Print Post  
Do you have a printer driver installed on the Vista system?
  
Back to top
 
IP Logged
 
Oskar
YaBB Newbies
*
Offline


I like YaBB 1G - SP1!

Posts: 21
Joined: Nov 28th, 2008
Re: Printing in Vista
Reply #2 - May 6th, 2009 at 2:09pm
Print Post  
Yes. I've tried this on three computers running vista and all of them behaved the same way.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing in Vista
Reply #3 - May 6th, 2009 at 2:30pm
Print Post  
Is it the same printer installed on all systems? What if you print while logged on as administrator?
  
Back to top
 
IP Logged
 
Oskar
YaBB Newbies
*
Offline


I like YaBB 1G - SP1!

Posts: 21
Joined: Nov 28th, 2008
Re: Printing in Vista
Reply #4 - May 6th, 2009 at 2:57pm
Print Post  
They have different printers and running as administrator doesn’t help. And It is possible to print if you go throw the print preview dialog, so the application has access to the printer.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing in Vista
Reply #5 - May 7th, 2009 at 11:41am
Print Post  
Print() works fine on all of our Vista systems. Do you have any software running on yours that might be monitoring the printers? What versions and service packs of Windows, the .NET runtime and Flowchart.NET do you have?
  
Back to top
 
IP Logged
 
Dan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 11th, 2009
Re: Printing in Vista
Reply #6 - May 11th, 2009 at 10:20am
Print Post  
Hi!
We are running on the following configurations.
Windows Vista Ultimat SP1 64 bit
MindFusion.Diagramming.Winforms.dll 5.2.1.22984
MindFusion.Diagramming.dll 5.2.1.22983
.NET 3.5 SP1

I wrote a small test application with a diagramview and three buttons, calling Print()/PrintPreview()/PrintPreeviewEx() respectively.

Recorded a small screencast that can be accessed from http://dan.meridium.se/FlowChartPrintTest.avi
Example project can be downloaded from http://dan.meridium.se/TestPrinting.rar
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing in Vista
Reply #7 - May 11th, 2009 at 12:14pm
Print Post  
So the print dialog is not shown at all? What if you use the Print(PrintDocument) overload, as in the Print() implementation shown below:

Code
Select All
public void Print()
{
	PrintDialog dlg = new PrintDialog();
	dlg.AllowPrintToFile = false;
	dlg.AllowSomePages = true;

	// Setup the .NET print document
	dlg.Document = new PrintDocument();
	dlg.Document.DocumentName = printOptions.DocumentName;
	dlg.Document.DefaultPageSettings.Margins = printOptions.Margins;
	dlg.Document.PrinterSettings.MinimumPage = 1;
	dlg.Document.PrinterSettings.MaximumPage = 10000;
	dlg.Document.PrinterSettings.FromPage = 1;
	dlg.Document.PrinterSettings.ToPage = 100;

	if (dlg.ShowDialog(this) == DialogResult.OK)
		Print(dlg.Document);
}
 



If this down not work, try removing the assignments to dlg.Document.PrinterSettings - perhaps the Windows Vista x64 print dialog does not like some of the values and just returns a result different from DialogResult.OK.

Stoyan
  
Back to top
 
IP Logged
 
Dan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 11th, 2009
Re: Printing in Vista
Reply #8 - May 11th, 2009 at 1:54pm
Print Post  
Hi!
Tried the example, but all I got from dlg.ShowDialog(this) was DialogResult.Cancel. Tried to skip the PrinterSettings but this didn't work anyway...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Printing in Vista
Reply #9 - May 11th, 2009 at 1:58pm
Print Post  
What if you try to only show the PrintDialog?

PrintDialog dlg = new PrintDialog();
if (dlg.ShowDialog(this) == DialogResult.OK)
     Print(dlg.Document);

This should use a default PrintDocument created by the dialog.
  
Back to top
 
IP Logged
 
Dan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 11th, 2009
Re: Printing in Vista
Reply #10 - May 12th, 2009 at 6:42am
Print Post  
Nah, that didn't work directly, but after searching for the problem I found a post http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/th... that suggested to set the dialog property UseEXDialog to true.
That did the trick...

The following code works...
Code
Select All
PrintDialog dlg = new PrintDialog();
dlg.UseEXDialog = true;
if (dlg.ShowDialog(this) == DialogResult.OK)
    diagramView1.Print(dlg.Document); 


  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint