Cannot work with custom enums

Stimulsoft Reports.NET discussion
Post Reply
mmelli
Posts: 3
Joined: Thu Apr 10, 2014 7:48 am

Cannot work with custom enums

Post by mmelli »

Hi, I'm using MVC Designer (Flash) to design my own reports. I need to use my BusinessObjects so I use the RegBusinessObject() method.
In the design environment I register a list containing only one object just to syncronize the dictionary. Then (after customizing) I save the report.

Later, when i run my report I load the report and then register the real data I need to show in it.

If one of the objects in my dictionary contains a property which type is an enum type, running the report throws me several errors indicating that this type isn't defined (The type or namespace name 'xxxx' could not be found (are you missing a using directive or an assembly reference?)).

This happens also if I leave my report blank, so the problem is in the definition of the BusinessObject.

How can I work with custom enums in my reports?
Do I have to register the dll where the enum is defined in some way?
Do I have to explicitly register the enum definition?

Thanks in advance,
Matteo
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Cannot work with custom enums

Post by HighAley »

Hello.

The assembly where your enum types are described should be added in the Referenced Assemblies of the report.

Next code shows how to do this:

Code: Select all

List<String> refs = new List<string>(report.ReferencedAssemblies);

if (!refs.Contains("Axsel.Kernel.dll"))
{
    refs.Add("Axsel.Kernel.dll");
}
report.ReferencedAssemblies = refs.ToArray();
Sometimes compiler can't get information about types if assembly is not installed into the global assembly cache.

Thank you.
Post Reply