ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Error Type ChartDirector.WinChartViewer is not defined
Posted by Aharoun Baalan on Dec-27-2013 16:08
Dear Sir

I am using Visual studio express2010.NET. I added ChartDirector 5.1  to VS2010 but when I
use it gives me the following error:

Type 'ChartDirector.WinChartViewer' is not defined.
Type 'XYChart' is not defined.

I searched for the source of this error. I found that I might have Chartdirecor assembly
duplicated or I have not added the reference through ?add reference?. I checked this; I
could not find an extra installation of ChartDirector in VS and it is added to the .NET and
the project.

What is wrong here?


Thanks
Aharoun

  Re: Error Type ChartDirector.WinChartViewer is not defined
Posted by Aharoun Baalan on Jan-06-2014 19:08
Any solutions please?

  Re: Error Type ChartDirector.WinChartViewer is not defined
Posted by Peter Kwan on Jan-07-2014 03:17
Hi Aharoun,

The error message usually means that your code is using ChartDirector, but your project does not reference ChartDirector.

When you create a VB project, Visual Studio by default will include a few default assembly references for the VB project.  For all other classes (including ChartDirector), to use them, one must add their assembly references to the VB project. If you have installed the assembly's controls into the Visual Studio toolbox, and you drag the controls to the Windows Form, Visual Studio will automatically adds the reference for you, so you can use the controls. For example, if you drag a ChartDirector WinChartViewer control onto a Windows Form, Visual Studio should automatically include the ChartDirector assembly (netchartdir_cp.dll) in the project reference.

However, if you have not drag a control to the form (eg. the Form file you use is copied from another place, not built by yourself), the reference may not be automatically added, and you would need to add the reference yourself.

In VB, you can view existing reference and add new references as follows:

(a) Right click on your VB project and select Properties

(b)  In the properties form that pop up, there should be a tab called "Reference". Please choose that tab.

(c) Check if the ChartDirector reference "netchartdir_cp" is already there. If not, please add them by clicking Add/Reference and browse to the "netchartdir_cp.dll" file, and press OK.

Note that before doing any other above, you should have already download ChartDirector for .NET and "unblock" it. (See http://www.advsofteng.com/unblock_zip.html for what is unblocking.)

Hope this can help.

Regards
Peter Kwan