Unhandled exception in Print Preview window of TeeChart.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Unhandled exception in Print Preview window of TeeChart.

Post by Nitin » Thu Nov 27, 2008 5:44 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 27, 2008 9:30 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

AIS
Newbie
Newbie
Posts: 70
Joined: Wed Jun 25, 2008 12:00 am

Post by AIS » Thu Nov 27, 2008 10:07 am

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 ;)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Nov 27, 2008 11:41 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

AIS
Newbie
Newbie
Posts: 70
Joined: Wed Jun 25, 2008 12:00 am

Post by AIS » Thu Nov 27, 2008 12:32 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 02, 2008 11:38 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

other problem Urgent

Post by Nitin » Mon Dec 08, 2008 6:03 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 09, 2008 12:54 pm

Hi Nitin,

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

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Post by Nitin » Thu Dec 11, 2008 3:54 am

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

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Post by Nitin » Thu Dec 11, 2008 7:31 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 11, 2008 10:53 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Post by Nitin » Thu Dec 11, 2008 12:01 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 11, 2008 12:20 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Nitin
Newbie
Newbie
Posts: 52
Joined: Fri Jun 30, 2006 12:00 am

Post by Nitin » Thu Dec 11, 2008 1:06 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 11, 2008 1:56 pm

Hi Nitin,

You may need to do as in the examples I posted here.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply