Page 1 of 1

Using Entity Framework Entities as Stimulsoft Report datasource

Posted: Tue Jul 26, 2011 3:20 pm
by dozer
Hi,

I'm currently investigating the use of Stimulsoft and we're using Entity Framework with Self-Tracking Entities as datasource in our project. So we want to also use this as datasource to our reports. The POCO objects that STE generates is placed in a seperate assembly that is used both on the server and the client of our N-Tier application and is transferred between these using WCF. The client has the responsibility to generate reports based on the data that is retrieved from the server.

Currently, when I'm testing this I have a problem which I can't find any solution and is a showstopper.

I load a report in which I set the datasource to my result (An order with orderlines which has article on each orderline) from the server using RegData (I can't use RegBusinessObject since it doesn't include my navigation properties).

When I try to render the report I get the following message in an exception:
The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)
So, my question is why? From the error message it seems that the autogenerated report code need to reference my assembly that contains my STE-POCO objects, but I can't find any way to do this. I know that RegBusinessObject works without this, but I can't use this since I need data in the navigation properties of my Order, OrderLine and Article in my report which RegBusinessObject doesn't expose to me.

So, how can I solve this critical problem?

Thanks for any solutions,
--Rune

Using Entity Framework Entities as Stimulsoft Report datasource

Posted: Tue Jul 26, 2011 4:14 pm
by dozer
Well..

I'll answer myself... It's good that Reflector exists which can be a lifesaver (at least timesaver) sometimes.

There is a property on the StiReport class that is named ReferencedAssemblies which has a public getter and setter and returns an array. So, this can be modified by this code:

Code: Select all

List assemblies = new List(report.ReferencedAssemblies);
assemblies.Add(System.Reflection.Assembly.GetAssembly(typeof()).Location);
report.ReferencedAssemblies = assemblies.ToArray();
Which adds the a reference during compiling to the assembly where resides.

--Rune

Using Entity Framework Entities as Stimulsoft Report datasource

Posted: Wed Jul 27, 2011 5:26 am
by Andrew
Hello,

Do we understand you correct the issue is solved?

Let us know if you need any additional help.
Thank you.

Using Entity Framework Entities as Stimulsoft Report datasource

Posted: Thu Jul 28, 2011 6:56 am
by dozer
Yes, problem solved :)

Using Entity Framework Entities as Stimulsoft Report datasource

Posted: Thu Jul 28, 2011 11:29 pm
by Andrew
Hello,

Great!

Thank you.