Page 1 of 1
Report code generation and generic types
Posted: Fri Jul 03, 2009 3:59 pm
by rpooley
I have been trying to figure out a problem I've been having with report compilation.
It seems that the method: public static string ConvertTypeToString(Type type, StiReportLanguageType language); converts generic types to object.
Is there any reason for this behaviour as I have a business object where I want to access the properties inside but it wont compile because it makes all generic types object.
Regards
Russell
Report code generation and generic types
Posted: Sat Jul 04, 2009 2:12 pm
by rpooley
Anyone here?
Report code generation and generic types
Posted: Mon Jul 06, 2009 7:26 am
by Jan
Hello,
Please check latest prerelease build which solve this problem.
Thank you.
Report code generation and generic types
Posted: Mon Jul 06, 2009 8:41 am
by rpooley
I have looked at release: SR_2009.06.30_D2005 and the code still shows:
if (type.IsGenericType)
{
return "Object";
}
I would have expected this to return the type in the generic format e.g. (EntitySet) in my example
Report code generation and generic types
Posted: Mon Jul 06, 2009 3:42 pm
by Jan
Hello,
Can you say which type of items with generic type you use in report engine - variables, business object or something also?
Thank you.
Report code generation and generic types
Posted: Mon Jul 06, 2009 5:06 pm
by rpooley
We are using Linq to SQL classes binding to an entity.
An example would be Member with related collection of Fees.
We would bind a List as the datasource to the report which would then generate properties for each of the properties on the Member type.
One of the properties is a collection of Fees the type being EntitySet.
When the report generator creates the CodeDom for the report it uses the ConvertTypeToString to get the type string for the collection property which I was expecting to be EntitySet but it generates the code with the property of type Object.
This causes a problem when I try and bind to the Fees.Count property on the Member.
I hope this explains a little.