I'm attempting to bind to a list of objects where the object has a public property that is of type TimeSpan?. The reporting framework (11.2 latest greatest) doesn't seem to like this (see below).
Any thoughts on how to work around this?
Infragistics.Reports.Engine.EngineException: Couldn't get the data type associated with type 'TimeSpan'. There is no class with name System.TimeSpanDataType in the same assembly. ---> System.TypeLoadException: Couldn't get the data type associated with type 'TimeSpan'. There is no class with name System.TimeSpanDataType in the same assembly.
at Infragistics.Models.Data.DataTypeCatalog.GetDataTypeInstanceFieldName(Boolean allowProxys, Type dataObjectType, Boolean isStatic, Boolean throwExceptionIfNotFound, DataType& dataType, Type type, Type& dataTypeType)
at Infragistics.Models.Data.DataTypeCatalog.GetDataType(Type type, Boolean allowProxys, Boolean throwExceptionIfNotFound)
at Infragistics.Models.Data.DataTypeCatalog.GetDataType(Type type, Boolean allowProxys)
at Infragistics.Models.Data.DataTypeCatalog.GetDataType(Type type)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.GetPropertyValueType(DataProperty property, Object value)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.CanBeSerializedInAttribute(DataProperty property, Object value, String bindingExpression)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WriteAttributes(DataPropertyValueCollection values, DataType ownerDataType, DataType objDataType, DataProperty contentProperty, Int32 offset)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WritePropertyValues(DataObject obj, DataType ownerDataType, Int32 offset)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WriteObject(DataObject obj, DataType ownerDataType, Boolean writeTags)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WriteItem(Object item, DataType ownerDataType, DataProperty property)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WriteCollection(IDataCollection collection, DataType ownerDataType, DataProperty property)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WritePropertyValue(DataProperty property, Object value, DataType objDataType, Boolean isContent, String contentStringValue, Boolean contentPreserveSpaces)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WritePropertyInElement(DataProperty property, Object value, DataType ownerDataType, DataType objDataType, String bindingExpression)
at Infragistics.Models.Data.Serialization.DataXmlWriter.Writer.WriteChildElements(DataPropertyValueCollection values, DataType ownerDataType, DataType objDataType, DataProperty contentProperty)
at Infragistics.Models.Data.Serialization.DataXmlWriter.SaveToString(DataObject obj, DataXmlWriterSettings settings)
at Infragistics.Reports.Engine.FragmentSerializer.SaveToString(DataObject fragment, DataXmlWriterSettings settings)
at Infragistics.Reports.Engine.FragmentSerializer.Serialize(Stream stream, Fragment fragment)
at Infragistics.Reports.Engine.MemoryReportStorage.Serialize[T](ISerializer`1 serializer, T value)
at Infragistics.Reports.Engine.MemoryReportStorage.Save[T](String moduleName, String key, Int32 index, T value, ISerializer`1 serializer)
--- End of inner exception stack trace ---
Hi,
This is a bug (internal issue number 96112). The serializer is having issues with the TimeSpans. As a workaround you can force the time span to be converted to string. For example, if the expression that returns a time span is =Fields.Period you should use =Fields.Period.ToString() instead.
Hope it helps.
Thanks,
Leo
HI,
This issue should be resolved by the latest service release.
Sincerely, Matt Developer Support Engineer
I am just following up on this forum thread.
Please let me know if you need further assistance.