Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8336353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:57:42+00:00 2026-06-09T03:57:42+00:00

I have a ASP.NET MVC 4 project with EF. I have a ASPX Web

  • 0

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);
   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:57:43+00:00Added an answer on June 9, 2026 at 3:57 am
    1. Using SP:

      CREATE PROCEDURE [dbo].spAgentOrders    
      (
      @fromdate DATE,
      @todate DATE
      )   
      AS
      DECLARE @from DATE = @fromdate, @to DATE = @todate
      SELECT o.orderbo, o.orderdate, o.ordervalue, o.status, a.name
      FROM orders o 
      JOIN agent a on o.id_agent = a.id_agent
      WHERE o.orderdate between @from and @to
      RETURN
      

    Update the Model, add the SP as a Function Import that returns a complex type.
    2. Webform codebehind:

    if (!IsPostBack)
    {
    //...
    var qry = db.spAgentOrders(tbFrom.Text, tbTo.Text);
    
    ReportDataSource dataSource = new ReportDataSource("DataSetOrder_Agent", qry);
    ReportViewerOrders.LocalReport.DataSources.Add(dataSource);
    }
    
    1. Update the report’s DataSource .xsd. Drag the SP from Server Explorer.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an ASP.Net MVC project that will start with a single web server
I have asp.net mvc 4 web application project on my server in IIS Directory.
I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a
I am stuck with redirecting problem in ASP.NET MVC project. I have mapped tables
I have ASP.Net MVC project. Plus wordpress blog under a subfolder /Blog. Now, when
I have an ASP.NET MVC project with xVal and data annotations and I need
I have an Asp.net MVC project that modestly uses jQuery scripts. My views also
I have a ASP.NET MVC 4 project and a SQL View (vvItem). ItemController MVCAppEntities
I have a new asp.net mvc project and i am trying to figure out
In Visual Studio 2010 I have an ASP.NET MVC 3 project called blahblah. As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.