Need some help with serialization and chart templates.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
IES Group
Newbie
Newbie
Posts: 1
Joined: Fri Dec 05, 2003 5:00 am
Location: Canada

Need some help with serialization and chart templates.

Post by IES Group » Tue Dec 16, 2003 7:08 pm

Hello, I have a class that I am serializing to a database field. In that class, i have various information about a chart, as well as a teechart template stored in a system.io.memorystream.

I can serialize this class to the database just fine. However, I do encounter a problem when I try to rehydrate the class and an exception is thrown. I appologize in advance about the non cut-n-paste messages since my dev machine is not allowed internet access at this location.

The exception is "Exception has been thrown by the target of an invocation."

The inner exception is:
{System.ArgumentOutOfRangeException}
Parameter name: Index was out of range.
Source: "mscorlib"
StackTrace: " at systems.collections.collectionbase.system.collections.ilist.get_Item(int32 index)
at steema.teechart.customaxes.get_item(int32 index)
at steema.teechart.import.imports.deserializefrom(blah)
at steema.teechart.chart..ctor(blah)
targetsite: {system.reflection.runtimemethodinfo)

Whew, lots to type, lol. Anyway, I'm looking for some ideas on how to squash this problem.

Marc
Site Admin
Site Admin
Posts: 1209
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Wed Jan 07, 2004 10:50 am

Hello,

Sorry for the delay with this reply. Some Serialisation modifications have been made to TeeChart for the current release. Please check if the problems still occur. If so, let us know and we'll look into them.

Regards,
Marc Meumann
Steema Support

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Tue Apr 22, 2008 5:21 am

Hi,

I got a "TeeChart deserialize Exception has been thrown by the target of an invocation." error message if the custom series is in a Class Library but not in executable application. After look into the source code, I found Steema.TeeChart.Import.Imports::FindType return a null value. I tried to add the following code segement and it works.

Code: Select all

:
:

				foreach (AssemblyName a in Assembly.GetExecutingAssembly().GetReferencedAssemblies())
				{
					Type result2=InternalFindType(typeName,Assembly.Load(a));
					if (result2!=null) 
						return result2;
				}

                //** Added: Erison@2008.04.22
                //{{
                foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
                {
                    try
                    {
                        Type result2 = InternalFindType(typeName, a);
                        if (result2 != null)
                            return result2;
                    }
                    catch (Exception ex)
                    {
                        System.Diagnostics.Trace.WriteLine(ex.Message);
                    }
                }
                //}}
:
:

Could you please try it and check if this is an issue in TeeChart.[/code]

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 Apr 22, 2008 10:22 am

Hi Erison,

Would you be so kind to let us know how can we reproduce this issue here? It would be very helpful if you sent 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.

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

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Tue Apr 22, 2008 1:07 pm

Hi,

I've sent the smaple code to you for testing. You can try to locate RectangleBubble.cs in different projects. It will be success if RectangleBubble.cs is located with main executable. But not work when RectangleBubble.cs is in a class library (seperate with main executable project).

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 Apr 22, 2008 1:29 pm

Hi Erison,

Thanks for your project but I'm unable to run it here because I get the following error message:
Error 5 Source file 'C:\temp\RectangleBubbleSeries\RectangleBubbleSeries\obj\SeriesOptionsBoxPlot.cs' could not be opened ('The system cannot find the file specified. ') RectangleBubbleSeries
Could you please send us that file so that we can reproduce the problem here?

BTW: You may also be interested in reading this thread about a very similar issue. Please notice thread has 2 pages.
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

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Tue Apr 22, 2008 10:21 pm

Hi,

Sorry about it. I've upload it again.

The thread you mention that I've been read before and seems don't resolve this issue. Could you please take a little time to try the code I upload to you. Thanks.


Best regards,

- Erison

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

Post by Narcís » Wed Apr 23, 2008 9:32 am

Hi Erison,

Thanks for the example project. To be able to run it I had to make a small change in RectangleBubble.cs that is changing the method overrid below from protected to public.

Code: Select all

        public override void Draw()
        {
            base.Draw();
        }
I couldn't reproduce the issue here with several importing/exporting combinations and the DrawLine checkbox. Should I follow any specific steps? I'm using latest TeeChart for .NET v3 release available at the client area. Which exact version are you using?

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

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Wed Apr 23, 2008 1:47 pm

Hi,

I use TeeChart for NET v2.0.2987.19069. Could you please test it in this version. Thanks.

Best regards,

- Erison

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Wed Apr 23, 2008 1:57 pm

Hi,

You can try to click "Save" button and then click "Restore". And then an error message will show up.

- Erison

Erison
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by Erison » Wed Apr 23, 2008 2:00 pm

Hi,

I've try TeeChart for .NET v2.0.3033.18431. The result is same.

- Erison

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

Post by Narcís » Wed Apr 23, 2008 2:19 pm

Hi Erison,

Thanks for the information. I could reproduce the issue here using v2.

TeeChart for .NET v2 offers support for serialization of standard types on Custom Series (such as Integer, double, boolean, etc). Support for custom types was added for TeeChart for .NET v3. I can confirm that your test project works fine with that version.

I'm going to send you a tutorial about this subject.
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