Ticket Q338037
Visible to All Users

xtrareport x entity framework

created 14 years ago

I use the Entity Framework as a source, and managed to assemble a detailed report using subreport (Q336230), I wonder if it is possible, create a report using Master-Detail Bands Detailed report, also using the data source entity framework .
 Is there a tutorial for this?

Show previous comments (6)

    Hi Ricardo,
    DXperience v2010 vol 1.5 supports EF relations, so you do not need to upgrade to the newest version. Would you please specify whether or not you have set relations between your entities as shown in the Foreign Keys in the Entity Framework MSDN article? I have created a new sample project and this functionality works fine on my side. Find it in the attachment. Please let us know whether or not this information helps you.
    Thanks,
    Sergi

      HI,
       The data source I have, not have Foreign Keys in the Entity Framework as it is a linq-to-Entities. My data source is:
              public class C_GetEmp_Depto
              {
                  public string INDICE { get; set; }
                  public string G_INDICE { get; set; }
                  public string CODIGO { get; set; }
                  public string DEPTO { get; set; }
                  public string SUBDEPTO { get; set; }
                  public decimal? VALOR { get; set; }
              }
              public static IQueryable<C_GetEmp_Depto_In_Fornecedor> GetEmp_Depto(DateTime data1, DateTime data2,Int32 local)
              {
                  var dataContext = new EMPENHOContainer();

      var res = (
                        from T1 in dataContext.EMP_ANUAL
                        where (T1.DATA >= @data1) & (T1.DATA <= @data2) & (T1.CODIGO4 == "5") & (T1.LOCAL == @local)
                        group T1 by T1.CODIGO1 into g
                        join T2 in dataContext.EMP_ORGAOS on g.Key equals T2.INDICE.Substring(0, 2) + T2.INDICE.Substring(3, 2)
                        select new C_GetEmp_Depto
                        {
                            G_INDICE=T2.INDICE+")"+T2.DEPTO+" / "+T2.SUBDEPTO,
                            DEPTO = T2.DEPTO,
                            SUBDEPTO=T2.SUBDEPTO,
                            INDICE= T2.INDICE,
                            CODIGO= T2.INDICE.Substring(0,2),
                            VALOR = g.Sum(p => p.VALOR)
                        });
                      res = res.OrderBy(a => a.INDICE);

      return res;
                  }
          public static IQueryable<EMP_ANUAL> GetEmp_EmpenhoS()
              {
                  return EMP_DB.db.EMP_ANUAL.Where(p => (p.CODIGO4 == "5"));
              }
      It is possible to create a master detail report with bands, with this data source?

        Hi Ricardo,
        I am afraid it is impossible to create a Master-Detail Report if your entities do not have relations between each other. This is not the XtraReports Suite limitation, but the data layer problem. In this case, it is impossible to link the Detail entity records to the Master entities. The only way to implement this functionality is to define relations between your entities.
        Thanks,
        Sergi

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.