Page 1 of 1

Need some help with serialization and chart templates.

Posted: Tue Dec 16, 2003 7:08 pm
by 8123158
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.

Posted: Wed Jan 07, 2004 10:50 am
by Marc
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

Posted: Tue Apr 22, 2008 5:21 am
by 9794210
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]

Posted: Tue Apr 22, 2008 10:22 am
by narcis
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.

Posted: Tue Apr 22, 2008 1:07 pm
by 9794210
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).

Posted: Tue Apr 22, 2008 1:29 pm
by narcis
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.

Posted: Tue Apr 22, 2008 10:21 pm
by 9794210
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

Posted: Wed Apr 23, 2008 9:32 am
by narcis
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.

Posted: Wed Apr 23, 2008 1:47 pm
by 9794210
Hi,

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

Best regards,

- Erison

Posted: Wed Apr 23, 2008 1:57 pm
by 9794210
Hi,

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

- Erison

Posted: Wed Apr 23, 2008 2:00 pm
by 9794210
Hi,

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

- Erison

Posted: Wed Apr 23, 2008 2:19 pm
by narcis
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.