Deserialization error when loading report

Stimulsoft Reports.WPF discussion
Post Reply
Jalmaria
Posts: 7
Joined: Thu May 03, 2018 9:03 am

Deserialization error when loading report

Post by Jalmaria »

Hi,

I have a strange problem. My report (which uses BusinessObjects as a datasource) works perfectly fine when loading from my test bench.
However, I get this error when I try to the same from our product:

2018:05:03, 18:59: StiReport: Loading report from file 'XXXReport.mrt'...ERROR
2018:05:03, 18:59: StiReport: Method : [GetConvertFromException] : TypeConverter cannot convert from System.String.
====================================================
at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
at System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
at Stimulsoft.Base.StiObjectStringConverter.StringToObject(String str, Type type) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\StiObjectStringConverter.cs:line 99
at Stimulsoft.Report.StiReportObjectStringConverter.StringToObject2(String str, Type type) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReportObjectStringConverter.cs:line 278
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(Object obj, StiPropertyInfoCollection props) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\Serializing\StiSerializing.cs:line 994
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(Object obj, StiPropertyInfoCollection props) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\Serializing\StiSerializing.cs:line 896
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(Object obj, StiPropertyInfoCollection props) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\Serializing\StiSerializing.cs:line 896
at Stimulsoft.Base.Serializing.StiSerializing.DeserializeObject(Object obj, StiPropertyInfoCollection props) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\Serializing\StiSerializing.cs:line 896
at Stimulsoft.Base.Serializing.StiSerializing.Deserialize(Object obj, Stream stream, String application) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Base\Serializing\StiSerializing.cs:line 1152
at Stimulsoft.Report.SaveLoad.StiXmlReportSLService.Load(StiReport report, Stream stream) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\SaveLoad\StiXmlReportSLService.cs:line 97
at Stimulsoft.Report.StiReport.Load(StiReportSLService service, Stream stream) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 1541
at Stimulsoft.Report.StiReport.Load(Stream stream) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 1414
at Stimulsoft.Report.StiReport.Load(String path) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 1455
====================================================

Maybe it is related to current locale? (ConvertFrom gets an culture)
I didn't find any locale specific texts in the report.mrt...
Jalmaria
Posts: 7
Joined: Thu May 03, 2018 9:03 am

Re: Deserialization error when loading report

Post by Jalmaria »

This happens also with an "empty" report... does the de-serialization depend on current culture?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Deserialization error when loading report

Post by Edward »

Hi Jalmaria,

That should not be the case, really as we are using Unicode.

Please feel free to attach the report template file in this topic for analysis.

Thank you,
Edward
Jalmaria
Posts: 7
Joined: Thu May 03, 2018 9:03 am

Re: Deserialization error when loading report

Post by Jalmaria »

Thanks,

Even the simplest report crashes. File attached.

Works in designer and in my test application, but not with the product itself.
Attachments
SimpleReport.mrt
(2.79 KiB) Downloaded 299 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Deserialization error when loading report

Post by HighAley »

Hello, Jalmaria.

We need to find any difference between your test application and your product.
Is it a desktop application in both case?
Do you use the same version of our assemblies? What version?
Do you use the same version of .Net Framework?
Please, try to put the assembly with your business objects to GAC.

Thank you.
Jalmaria
Posts: 7
Joined: Thu May 03, 2018 9:03 am

Re: Deserialization error when loading report

Post by Jalmaria »

Thanks,

Both are desktop applications, use same StimulSoft assemblies (2018.2.2), and same .NET Framework version (4.5.2).
Actually the code (assembly) is the same, just the loading application changes. Real product is a mixed mode app (native and managed), if that makes any difference?
I ended up removing tags from the report file one by one. The problem tag is: StiSerializer\Pages\Page1\Margins (<Margins>1,1,1,1</Margins>).
If I remove that tag, the report gets de-serialized fine, but crashes later (of course).
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Deserialization error when loading report

Post by HighAley »

Hello, Jalmaria.

It seems that the issue in getting class attributes from an assembly.
We are using next attributes

Code: Select all

[TypeConverter(typeof(Stimulsoft.Report.Components.Design.StiMarginsTypeConverter))]
We had got just a few such issues. The solution was to install the assembly to GAC.
Have you installed our assemblies to GAC? Please, try to do it.

Thank you.
Jalmaria
Posts: 7
Joined: Thu May 03, 2018 9:03 am

Re: Deserialization error when loading report

Post by Jalmaria »

Thanks, fixed the problem.
What's the minimum set of assemblies which require GAC installation? Could it be fixed in upcoming versions?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Deserialization error when loading report

Post by HighAley »

Hello.

The minimum set of assemblies depends on features that you use.
Anyway you need Stimulsoft.Base.dll and Stimulsoft.Report.dll assemblies.

We can't reproduce the issue on our side and it appears at a few our clients.
So, at this moment we can't do anything.

Thank you.
Post Reply