Page 1 of 3

Unhandled exception in Print Preview window of TeeChart.

Posted: Thu Nov 27, 2008 5:44 am
by 9346725
Hi,
we are using TeeChart pro v 2.0.2489.20960 and code is like this...

Code: Select all

Steema.TeeChart.Printer pcPrinter = new Steema.TeeChart.Printer(new Steema.TeeChart.Chart());
pcPrinter=profileTeeChart.Printer;
pcPrinter.BeginPrint();
profileTeeChart.Header.Visible = true;
String templateName="";
if(CurrentTemplateOID!=null && CurrentTemplateOID!="")
{
	BusinessReference brt = new BusinessReference(context,CurrentTemplateOID);
	templateName=brt["Name"].ToString();
}
else
{
               templateName="New Template";
	logger.Debug("Template name set to: New Template");
}
profileTeeChart.Header.Text = templateName+"-"+displayWindowID;
pcPrinter.Print(profileTeeChart.Chart,new Rectangle(20,30,770,400));
pcPrinter.Preview();
After this line printPreview window pops UP there user has confifured following printer "Microsoft Office Document Image Writer" which seems to be not the installed/correct one. Now in the PrintPreview window when user click on Print button "save as" window pops up now if user clicks on cancel he is getting the unhandled exception.
Details of exception is as follows--
************** Exception Text **************
System.ComponentModel.Win32Exception: The operation was canceled by the user
at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at Steema.TeeChart.Editors.PrintPreview.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Can you tell what is the problem...

Thanks.

Posted: Thu Nov 27, 2008 9:30 am
by narcis
Hi Nitin,

I'm not able to reproduce the problem here. When print preview is displayed default computer printer is selected. If I manually select "Microsoft Office Document Image Writer" press "save as" and "cancel" I don't get the exception either.

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Also notice a newer TeeChart for .NET v2 release is available at the client area. You may want to check if this solves the problem at your end.

Thanks in advance.

Posted: Thu Nov 27, 2008 10:07 am
by 13049497
Hello,

i have also get this exceptions, but with techart v3. I found out, that i have must installed one real printer as minimum. My colleage has not get this exceptions (without any real printer). So, we use a own PrintPreviewDialog ;)

Posted: Thu Nov 27, 2008 11:41 am
by narcis
Hello Nitin and AIS,

I have done several tests using the code Nitin posted and couldn't reproduce the issue here. I have tried using a network printer, virtual printers, machine with only virtual printers, turning off the network printer and also removing all printers from a machine without any error at all.

We suspect this is some problem with the machine you're trying to print from. Does the same printer on that machine works fine with other applications? Can you reproduce the same problem with TeeChart in other machines? Can you try it in a machine without no printers at all?

Thanks in advance.

Posted: Thu Nov 27, 2008 12:32 pm
by 13049497
Hi Narcís,

i can`t reproduce this exceptions with my current machine and can`t test it with my old one. I think, it depends on some machine settings or random cases.

Posted: Tue Dec 02, 2008 11:38 am
by narcis
Hi Nitin,

I've casually found the video you posted at the upload page. When you send us files it's better informing us of this as otherwise we may not look for them or not know which issue they are about.

I believe the problem happens at your end but could you please answer the questions I made in my previous post on this thread?

Thanks in advance.

other problem Urgent

Posted: Mon Dec 08, 2008 6:03 am
by 9346725
Hi Narcís,
Today I tried the same step with MS outlook and it has also displays the same save asdialog box. But as soon as I clicked on cancel button it says "Printer not ready" in information dialog which seems to me the correct thing.
This issues appeared on test box first and then I am also able to reproduce as I showed you in Vedio.
Later on I have installed the TeeChart Pro ver. 3.5.3188.18560. and repeated the same steps. But this time that exception message didn't come. But as soon as I assigned the invalid printer on the network and close the Print Preview window and open it again that time it is giving the Invalid printer Unhandeled exception.
Other then this Now most important problem we are facing is our chart functionality stops working. I Mean by that is after applying the TeeChart Pro ver. 3.5.3188.18560 when we launch the application TeeChart area appears to be grayed out and we are not able to see any chart. Zoom and Unzoom seems to be working fine.
Could you please let me know what changes I need to do in order to see the TeeChart without the Gray color. As Initially it was appeared to be white when we lauch the application and was displaying the chart also. Please respond to this issue Immediately as this has become an urgent issue now.
Please let me know if you need more info.

Thanks,
Nitin

Posted: Tue Dec 09, 2008 12:54 pm
by narcis
Hi Nitin,

Have you checked that your project's TeeChart.dll references have been correctly upgraded to the new TeeChart version?

Thanks in advance.

Posted: Thu Dec 11, 2008 3:54 am
by 9346725
All references are correct. Could you tell me that are the different properties which is being used to set the background colour of the teechart in the version I have mentioned. I think it is background color which is not set properly. We are using colorGrid and surface series also.

Thanks,
Nitin

Posted: Thu Dec 11, 2008 7:31 am
by 9346725
I have Uploaded the demo Project which is having problem. could you please look at it. Password of the file is Nitin. I want the background color to be white. I tried with same code with old version and it seems to be working.

Thanks,
Nitin

Posted: Thu Dec 11, 2008 10:53 am
by narcis
Hi Nitin,

Yes, you can use this:

Code: Select all

			tChart1.Panel.Brush.Gradient.Visible = false;
			tChart1.Panel.Brush.Color = Color.White;

			tChart2.Panel.Brush.Gradient.Visible = false;
			tChart2.Panel.Brush.Color = Color.White;
			//tChart2.Walls.Back.Transparent = false;
			//tChart2.Walls.Back.Gradient.Visible = false;
			//tChart2.Walls.Back.Color = Color.Red;

Posted: Thu Dec 11, 2008 12:01 pm
by 9346725
Hi Narcis,
I have added this code you've mentioned in my application and after that chart is comming in white color. But later as we are reading scan value from scannere and adding those value to colorGrid series which is the part of teechart. According to our appliation teechart should now display cells of different color based on the value added to the color grid. But it is showing white color only all the time. Earlier it was working fine with previous version. Do you know which property I need to set again so that colorGrid cells become vissble instead of white color.
I appreciate your help.

Thanks,
Nitin

Posted: Thu Dec 11, 2008 12:20 pm
by narcis
Hi Nitin,

You can try using this:

Code: Select all

			colorGrid1.UseColorRange = false;
			colorGrid1.UsePalette = true;
			colorGrid1.PaletteStyle = Steema.TeeChart.Styles.PaletteStyles.Pale;
If problem persists please send us a simple example project we can run "as-is" to reproduce the problem here.

Thanks in advance.

Posted: Thu Dec 11, 2008 1:06 pm
by 9346725
We are using palette to display differnt color for each cell of colorGrid series. So, this code is not working. Any other property which need to be set? We are using surface series also.

Thanks,
Nitin

Posted: Thu Dec 11, 2008 1:56 pm
by narcis
Hi Nitin,

You may need to do as in the examples I posted here.