Property with List of Objects in Crystal Reports

1

I have the following classes:

public class objeto1
{
   public string Descricao {get;set;}
   public List<objeto2> Objeto2 {get;set}
}

public class objeto2
{
   public string Descricao {get;set}
   public decimal Valor {get;set}
}

I'm using Crystal Reports and would like to use the object1 class to build a report. So I can send a list of object1 and read it in Crystal Reports . Home The problem is that I can only view the Description property of object1 , but I can not access the List of object2 no Database Fields . Home It is worth mentioning that this is the first time I use CR.

    
asked by anonymous 18.08.2015 / 19:25

1 answer

0

You did not have to use the Objects that way. The way was to create a new property for each one with a Id , so in Crystal Reports I can make a link between them.

public class objeto1
{
   public int Id {get;set}
   public string Descricao {get;set;}
}

public class objeto2
{
   public int IddoPai {get;set}
   public string Descricao {get;set}
   public decimal Valor {get;set}
}

So, I was able to pass% s of% and a list of objeto1 to Crystal Reports.

    
20.08.2015 / 23:42