Exports.ShowExportDialog causes exception.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Shengfeng.yao
Newbie
Newbie
Posts: 2
Joined: Wed Feb 16, 2011 12:00 am

Exports.ShowExportDialog causes exception.

Post by Shengfeng.yao » Tue Aug 09, 2011 7:52 am

I just upgrade the tee chart dll from "Teechart Pro for .Net v1" to "TeeChart for .Net 2010".
An exception occured when the ShowExportDialog invoked.
The exception information as follow:
System.ArgumentOutOfRangeException: Value of '0' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
Parameter name: Value
at System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
at Steema.TeeChart.Editors.Export.ExportEditor.listBox1_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ListBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ListBox.set_SelectedIndex(Int32 value)
at Steema.TeeChart.Editors.Export.ExportEditor.SetTabs()
at Steema.TeeChart.Editors.Export.ExportEditor.ExportEditor_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Is there any special setting for the "ShowExportDialog" in new interface?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exports.ShowExportDialog causes exception.

Post by Sandra » Tue Aug 09, 2011 12:03 pm

Hello Shengfeng.yao,

When I use following line of code in last version:

Code: Select all

 tChart1.Export.ShowExportDialog();
It works fine for me. Please try to arrange a simple project for us, so we can try to help you to solve your problem.

Thanks,
Best Regards,
Sandra Pazos / 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

Shengfeng.yao
Newbie
Newbie
Posts: 2
Joined: Wed Feb 16, 2011 12:00 am

Re: Exports.ShowExportDialog causes exception.

Post by Shengfeng.yao » Wed Aug 10, 2011 2:52 am

Hi Sandra,
In my souce code, I defined a commander class wich inherit from teechart.commander.
The code for 'Print Button' (btnPrint) is similar with 'Save Button' (btnSave).
When run the program, code for 'Print Button' works well, but the 'Save Button', the error message displayed.

Any comments will be very appreciated.
Best Regards,
Shengfeng Yao

The source code as below:

public class CommanderEx : Steema.TeeChart.Commander, Steema.TeeChart.ITeeEventListener
{
//In this class, handle the click event
protected override void OnButtonClick(System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
//other process....

HandleTBButtonClick(this, e);
}
}

public void HandleTBButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
// Evaluate the Button property to determine which button was clicked.
switch ((TBButtons)((System.Windows.Forms.ToolBar)_toolBar).Buttons.IndexOf(e.Button))
{
case TBButtons.btn3D:
{
break;
}
case TBButtons.btnEdit:
{

break;
}
case TBButtons.btnCopy:
{

break;
}
case TBButtons.btnPrint: //This works well
{
try
{
if (this.ViewCollection.SelectedDistributionViews.Count == 1)
{
EnsureToolbarSelectedChart();

_toolBar.Chart.Chart.Printer.Preview();
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
break;
}
case TBButtons.btnSave:
{
try
{
if (this.ViewCollection.SelectedDistributionViews.Count == 1)
{
EnsureToolbarSelectedChart();
_toolBar.Chart.Chart.Export.ShowExportDialog(); //error message displayed,but the exception not caught.
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
break;
}
case TBButtons.btnFocused:
{

break;
}
case TBButtons.btnViewChart:
{

break;
}
case TBButtons.btnViewTable:
{

break;
}
case TBButtons.btnViewPercent:
{

break;
}

case TBButtons.btnConfig:
{
this.Cursor = Cursors.WaitCursor;

// Show the configuration form
this.ShowConfigForm();
this.Cursor = Cursors.Default;
break;
}
case TBButtons.btnDelete:
{
if (_mnuDeleteSelected.Visible == true)
{
this.HandleDelete(true);
}
else
{
this.HandleDelete(false);
}

break;
}
}

}
catch (Exception ex)
{
Trace.Instance.TraceException(ex, true);
MessageBox.Show("Error in Distributions: " + ex.ToString());
Debug.WriteLine(string.Format("HandleTBButtonClick : caught an exception {0}", ex.ToString()));
this.Cursor = Cursors.Default;
}
}

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Exports.ShowExportDialog causes exception.

Post by Sandra » Wed Aug 10, 2011 10:23 am

Hello Shengfeng.yao,

Thanks for your lines of code,but I couldn't reproduce your problem with it. I would be very grateful if you send us your project so we can reproduce exactly, your problem.

Thanks,
Best Regards,
Sandra Pazos / 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