Totals for custom type properties
Hi,
I'm using FastReport.NET 1.9.1 with a list of business objects as a data source.
Business object has several properties of different standard types (such as String, double, DateTime), as well as properties of custom ref and value classes.
Custom classes having overloaded arithmetical operators and overloaded ToString methods for formatting. Also implements IConvertable interface.
Everything works fine, I can use these properties in various expressions.
But when I use them in Totals I get:
System.InvalidOperationException: Cannot implicitly add value to unidentified type.
at FastReport.Variant.op_Addition(Variant subjectVariant, Object value)
at FastReport.Data.Total.AddValue(Object value)
at FastReport.Data.Total.AddValue()
at FastReport.Data.TotalCollection.ProcessBand(BandBase band)
at FastReport.Engine.ReportEngine.ProcessTotals(BandBase band)
at FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData)
...
This only happens when list of business objects has more than one object.
Tried overloading different addition operators, such as
static MyClass^ operator + (FastReport::Variant v1, MyClass^ v2);
static FastReport::Variant v1 operator + (FastReport::Variant v1, MyClass^ v2);
Nothing helps.
Am I missing something, should I implement some interfaces for custom classes or inherit from some class, or register them somehow with FastReport as it's done for custom PictureObjects?
Thanks,
Alexander
I'm using FastReport.NET 1.9.1 with a list of business objects as a data source.
Business object has several properties of different standard types (such as String, double, DateTime), as well as properties of custom ref and value classes.
Custom classes having overloaded arithmetical operators and overloaded ToString methods for formatting. Also implements IConvertable interface.
Everything works fine, I can use these properties in various expressions.
But when I use them in Totals I get:
System.InvalidOperationException: Cannot implicitly add value to unidentified type.
at FastReport.Variant.op_Addition(Variant subjectVariant, Object value)
at FastReport.Data.Total.AddValue(Object value)
at FastReport.Data.Total.AddValue()
at FastReport.Data.TotalCollection.ProcessBand(BandBase band)
at FastReport.Engine.ReportEngine.ProcessTotals(BandBase band)
at FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData)
...
This only happens when list of business objects has more than one object.
Tried overloading different addition operators, such as
static MyClass^ operator + (FastReport::Variant v1, MyClass^ v2);
static FastReport::Variant v1 operator + (FastReport::Variant v1, MyClass^ v2);
Nothing helps.
Am I missing something, should I implement some interfaces for custom classes or inherit from some class, or register them somehow with FastReport as it's done for custom PictureObjects?
Thanks,
Alexander
Comments