Master-Detail-Detail with TList

Hi,
 I'm trying to build a report(Master-Detail-Detail) with TList<Employee>, i can not reach 2? Detail, here his the error message and the classes:

"...exception class EFlexCelCoreException with message 'The named range "ProductList" on the Excel template refers to DataTable "ProductList" which is not defined. Verify that you added the dataset with FlexCelReport.AddTable method.'."

    Pruduct = Class
    public
      ProductNr: Integer;
      Name: String;
   end;
   OrderItem = Class
   public
     OrderItemNr: Integer;
     ProductList: TList<TProduct>;
   end;

   Orders = Class
   public
     OrderNr: Integer;
     OrderItem: TList<OrderItem>
   end;

   Employee = class
   public
     FirstName: string;
     LastName: string;
    Orders: TList<TOrder>;
  end;

First time with flexcel :)
thanks



Hi,

There should be no problem stacking names inside names: The only thing to be aware is that each child name should be contained in the parent name. That is ProductList should be inside a name orderitem. And orderitem should be inside Orders and so on.  This is the way FlexCel knows that Productlist refers to a property in orderitem, and not to another table. So you can't skip any name: You can't just have Orders and inside ProductList. You need the full hierarchy.

Other than that, it should just work. I've created a little example with your classes which you can try here:

http://www.tmssoftware.biz/flexcel/samples/2levels.zip

Please note that this app is not an example on how to code. It leaks memory like a sieve, because I didn't worry to free all the objects I created. And to make it simpler, I would use TObjectList<Whatever> instead of TList<Whatever> so all the children in the list are destroyed when the main list is destroyed. Also, I had to make some typo corrections to your classes to compile. (for example, I changed "Pruduct" to "Product" and added some "T"s to the classes names so you can have a list<TOder> instead of a List<order>

If you still can't make it work, feel free to contact me to adrian@tmssoftware.com with an example file that doesn't work and I'll take a look and discuss it further here.

Ok, thanks, i'm enjoying :)