property with Crystal Reports Objects List

Asked

Viewed 319 times

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 the Crystal Reports and would like to use the class of object 1 to build a report. So I can send a list of object 1 and do the reading on Crystal Reports.
The problem is I can only visualize the property Description of object 1, but I can’t access List of object2 in the Database Fields.
It is worth mentioning that it is the first time I use CR.

1 answer

0


There was no way to use Objects this way. The way was to create a new property for each one with a Id, so in Cristal 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 on to Crystal Reports objeto1 and a list of objeto2.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.