Need some help with serialization and chart templates.
Need some help with serialization and chart templates.
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.
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.
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.
Could you please try it and check if this is an issue in TeeChart.[/code]
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);
}
}
//}}
:
:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Erison,
Thanks for your project but I'm unable to run it here because I get the following error message:
BTW: You may also be interested in reading this thread about a very similar issue. Please notice thread has 2 pages.
Thanks for your project but I'm unable to run it here because I get the following error message:
Could you please send us that file so that we can reproduce the problem here?Error 5 Source file 'C:\temp\RectangleBubbleSeries\RectangleBubbleSeries\obj\SeriesOptionsBoxPlot.cs' could not be opened ('The system cannot find the file specified. ') RectangleBubbleSeries
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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.
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();
}
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |