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?
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.
Hi Ricardo,
Thank you for contacting us. Yes, it is possible. Please refer to the How to create a hierarchical master-detail datasource example illustrating how to accomplish a similar task.
We look forward to your feedback once you have had the opportunity to try this approach.
Thanks,
Sergi
I checked the example, however, this example creates the entire report at run-time. What do I like to do, was to create a report at design time, and inform the database at run-time. Is it possible?
Hi Ricardo,
To accomplish this, combine approaches from the How to: Create a Master-Detail Report using Detail Report Bands and How to: Bind a Report to a List Object at Design Time and Provide Data at Runtime articles.
I mean that you need to design a report as shown in the first article and bind the report to data as shown in the second topic.
Hopefully, this information helps you.
Thanks,
Sergi
EXACT, I TRIED TO DO THAT. But WHEN I CLICK INSERT DETAIL REPORT, SO HAVE THE OPTION UNBOOUND. SHOULD NOT APPEAR ON THE BINDINDING DATASORUCE THAT WAS CREATED?
Hi Ricardo,
Thank you for your feedback. Would you please specify which version of our controls you are using? Entity Framework relations were not fully supported in earlier versions of the XtraReports Suite. Please refer to the Master-detail report and Entity Framework thread that describes this problem in greater detail. We have improved this behavior in the context of the Data Binding - Support for master-detail EntityFramework relations suggestion.
If you are using an older version of the XtraReports Suite, download the newest DXperience v2011 vol 1.6 trial version of our DevExpress controls from the Downloads link and test this functionality. Please feel free to contact us if the problem still exists.
Thanks,
Sergi
HI, MY version is Version = 11.1.5.0. Should I upgrade? will change anything?
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