LLBLGen entities in microsoft reporting

Posts   
 
    
Depaaj
User
Posts: 2
Joined: 07-May-2010
# Posted on: 07-May-2010 22:12:33   

Hello,

I'm trying to use LLBLGen Pro (v2.6) generated entities as DataSets in my MS Reporting reports. This works pretty well but i've got major problems using entities that have m:n relations to each other.

To illustrate this problem I will try to explain it with a simple real-world case:

A product has 1 or more properties A property can belong to 1 or more products

LLBLGen Pro generates the both classes nicely with the CollectionClasses as properties, for example:

The class ProductEntity has an property called PropertyCollection The class PropertyEntity has an property called ProductCollection

This is the situation that Visuals Studio report designer (VS2008 and VS2010) cannot handle. As soon as this situation occurs and adding an entity class like this as a report dataset, VS will hang for a minute or so and will then close en restart.

Is there anybody else experiencing the same problem? At this moment I found a simple solution for this problem by generating a separate entity class for reporting purposes, with the m:n relations turned off, only i find this very annoying because I just want to use the default entity classes.

Hope someone can help me!

Thanks in advance!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-May-2010 03:06:59   

I don't use SSRS that way. I always project my collections to Datasets and use them as datasources, so far so good.

Maybe SSRS goes in a recursive issue trying to reference the two endpoints of the m:n collection. How many datasources do you have in the report designer? how you reference the data in the report?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 08-May-2010 11:58:36   

Do you also see the problem when you bind a grid on winforms to a collection of the same entity?

There was a bug in vs.net 2005's winforms designer which ran into an infinite loop because of the cyclic references caused by the m:n relation. In vs.net 2008 it was fixed. Apparently the report writer of microsoft still has the same problem: it keeps asking for type data which it already has retrieved, causing an infinite loop. (Customer.Employees m:n Employee.Customers -> Customer.Employees returns Employee type data, it sees a 'Customers' property, retrieves Customer type data, it sees 'Employees' property, retrieves Employee type data (which it already has) etc. etc.

Frans Bouma | Lead developer LLBLGen Pro
Depaaj
User
Posts: 2
Joined: 07-May-2010
# Posted on: 08-May-2010 23:08:43   

@Dealmo,

It doesn't matter how many datasources I have, adding just 1 dataset of 1 datasource will give me the same problem.

@Otis,

I use the datagridview control very often and that does not give any problems. The problem is exactly as you describe with the infinite loop situation but I was/am hoping someone has an solution for this problem..

Thanks for the reply!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-May-2010 10:44:34   

So most prbably this is the same issue as that in VS 2005.

Can you fall back to the dataset projection approach?

Simonbr
User
Posts: 5
Joined: 17-Aug-2010
# Posted on: 17-Aug-2010 21:52:32   

Hi,

I have the same issue (I suppose). I use to bind my collectionclasses and entityclasses to my Winforms reports (rdlc). That always worked very well. Since I migrated from VS2008 to VS2010 I am no longer able to bind my report datasources to the reports. I can no longer modify or create new reports... Whenever I try to select a collection- or entityclass, Visual Studio hangs and crashes!

I urgently (tomorrow simple_smile ) have to deliver some modifications to my reports. Is there a solution?

Kind regards,

Simon

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 17-Aug-2010 22:06:27   

The solution appears to be to project your entity collections to DataSets, and use those in your reports. Is this a possible solution for you?

Matt

Simonbr
User
Posts: 5
Joined: 17-Aug-2010
# Posted on: 17-Aug-2010 22:08:49   

What exactly do you mean by that? Is it possible to give a small example? That means that I have to change all the datasources of all my reports? (+100 reports) disappointed

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 17-Aug-2010 22:55:38   

Search the documentation for projection, there are many examples in there. http://www.llblgen.com/documentation/2.6/hh_start.htm

I'm not sure there is another way round this at the moment.

Matt

Simonbr
User
Posts: 5
Joined: 17-Aug-2010
# Posted on: 17-Aug-2010 22:57:00   

Does that stays the same for v3? I migrated my project to v3 for that reason :s

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 18-Aug-2010 06:13:03   

Simonbr wrote:

I have the same issue (I suppose). I use to bind my collectionclasses and entityclasses to my Winforms reports (rdlc). That always worked very well. Since I migrated from VS2008 to VS2010 I am no longer able to bind my report datasources to the reports. I can no longer modify or create new reports... Whenever I try to select a collection- or entityclass, Visual Studio hangs and crashes!

Does this happen whit every entity collection class? Does this happen also with DataGridViews?

Simonbr wrote:

Does that stays the same for v3? I migrated my project to v3 for that reason :s

Yes, it does.

David Elizondo | LLBLGen Support Team
Simonbr
User
Posts: 5
Joined: 17-Aug-2010
# Posted on: 18-Aug-2010 12:12:24   

Hi,

When I create a new, clean project and add a reference to my dao project, I am able to use a collection class from an entity without relations...

I have no problem with the DGVs...

This really is a big issue for me... Means I have to change all the datasets of my reports... And what about the custom entity code I added to my entities, can I access it with the workaround?

Kind regards,

Simon

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Aug-2010 17:15:22   

Here is the direct link to v.3.0 documentation: Hierarchical projections of entity collections

This really is a big issue for me... Means I have to change all the datasets of my reports... And what about the custom entity code I added to my entities, can I access it with the workaround?

What custom entity code? What does it do? And how did you use it in reporting?

Simonbr
User
Posts: 5
Joined: 17-Aug-2010
# Posted on: 18-Aug-2010 17:32:47   

The custom entity code will fetch data from other tables and will provide me some images (byte array)... I use those properties in my reports...

In my reporting, I choose for 'object' as datasource and select my collection or entity class from the dao dll. VS generates then the datasource code in the rdlc file...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-Aug-2010 17:48:53   

Projecting to a dataSet, you can project any property of the entity class (whether it's mapped to a database field or not).

So for example you can create a property called "Photo" which has some logic in it's "Get" to fetch the binary image from the database and return it as a Byte[].