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

  • SEARCH
  • Home
  • 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 8382625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:58:20+00:00 2026-06-09T16:58:20+00:00

I have a view that must render two reports. My action: public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel

  • 0

I have a view that must render two reports.

My action:

public ActionResult TradeUKKPIShowData(SundaysInMonthViewModel model) //show actual data in the view
{
  var tradesmenReportData = _reportingService.GetTradeUKKPITradesmen(model.SelectedSunday);
  var jobSortedReportData = _reportingService.GetTradeUKKPIJobSorted(model.SelectedSunday);
  ViewBag.jobSortedReportDate = model.SelectedSunday;
  ViewBag.addJobSortedModel = jobSortedReportData;
  return View(tradesmenReportData);
}

My first problem is with the first two lines of the action above. What must I pass here?
The compile errors I get for those lines:

‘TradeUK.Services.IReportingService.GetTradeUKKPITradesmen(TradeUK.Entities.Reporting.KPIResults)’ has some invalid arguments

All the stored procedure for the report needs is the date/sunday that was selected

My SundaysInMonthViewModel:

 namespace TradeUK.Admin.Web.ViewModels
 {
    public class SundaysInMonthViewModel
    {
       public IEnumerable<SelectListItem> AllSundays { set; get; }
       public string SelectedSunday { set; get; }
    }
 }

Here IReportingServices.cs:

IEnumerable<KPIResults> GetTradeUKKPITradesmen(DateTime date);
IEnumerable<KPIResults> GetTradeUKKPIJobSorted(DateTime date);

and the actual methods for above:

 public IEnumerable<KPIResults> GetTradeUKKPITradesmen(DateTime date)
 {
 }


 public IEnumerable<KPIResults> GetTradeUKKPIJobSorted(DateTime date)
 {
 }

KPIResults:

namespace TradeUK.Entities.Reporting
{
 public class KPIResults
  {
   public virtual string Title { get; set; }
   public virtual int Total { get; set; }
   public virtual int Week6 { get; set; }
   public virtual int Week5 { get; set; }
   public virtual int Week4 { get; set; }
   public virtual int Week3 { get; set; }
   public virtual int Week2 { get; set; }
   public virtual int Week1 { get; set; }
  }
 }

The other issue is on the return(View(tradesmenReportData,jobSortedReportData)
Can I do this? In the actual view I have to foreach loops to show the to sets of report data.

Please help?
Thanks

  • 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-09T16:58:22+00:00Added an answer on June 9, 2026 at 4:58 pm

    You can pass first model normally and second in ViewBag and then

    @model YourFirstModelClass
    
    @{
        YourSecondModelClass model2 = ViewBag.YourSecondModel;
    }
    

    And and with it you have effect which you want.

    So when you do not use Razor you can add primary strongly typed model like this:

    <%@ Inherits="System.Web.Mvc.ViewPage<PrimaryModelClass>" %>
    

    and second in ViewData similary to ViewBag

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am beginner in rails. I have view that i try to print inside
I have a view that has a column to make it sortable. When clicking
I have a view that renders a list elements using the following template :
I have a view that shows user profile fields in a tabular format. There
I have a view that is used in a UINavigationController and and is automatically
I have a View that is basically setup like this: <Grid> <ViewBox> <Grid> <ItemsControl
I have a View that contains a ParentModel, which contains 2 Models. I only
I have a view that has a tooltip attribute. I want to set that
I have a view that could be called from any of 3 actions from
I have a view that is loaded in the MainWindow.xib. It is just a

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.