I have a ASP.NET MVC 4 project with EF. I have a ASPX Web Page to display a ReportControl for RDLC reports.
There I have 2 tables : Orders and Agents. In my report I want to display (in a Tablix) all my orders.
OrderNo | OrderDate | OrderTotal | OrderStatus | Agent
(Agent column is the name of the agent : “Agent.Name”)
Q : How can I display a field(Agent.Name) from another table(Agent) in a Tablix?
if (!IsPostBack)
{
var qry = FROM o in db.Orders
//JOIN a in d.Agents on o.idAgent equals a.idAgent
SELECT o; //
ReportDataSource dataSource = new ReportDataSource("DataSetOrder_Agent", qry);
ReportViewerOrders.LocalReport.DataSources.Add(dataSource);
}
Using SP:
Update the Model, add the SP as a Function Import that returns a complex type.
2. Webform codebehind: