Report code generation and generic types

Stimulsoft Reports.NET discussion
Post Reply
rpooley
Posts: 15
Joined: Mon Jun 29, 2009 10:24 am
Location: London

Report code generation and generic types

Post 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
rpooley
Posts: 15
Joined: Mon Jun 29, 2009 10:24 am
Location: London

Report code generation and generic types

Post by rpooley »

Anyone here?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Report code generation and generic types

Post by Jan »

Hello,

Please check latest prerelease build which solve this problem.

Thank you.
rpooley
Posts: 15
Joined: Mon Jun 29, 2009 10:24 am
Location: London

Report code generation and generic types

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Report code generation and generic types

Post 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.
rpooley
Posts: 15
Joined: Mon Jun 29, 2009 10:24 am
Location: London

Report code generation and generic types

Post 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.
Post Reply