Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
These are My Drop downs in DesignPage.cshtml

@Html.LabelFor(m => m.LocationId, new { @class = "label_intro" })
@Html.DropDownListFor(m => m.LocationId,
new SelectList(Model.Locations.ToList(), "Id", "Name", Model.LocationId),
new { id = "patron-location", style = " width:300px", @class = "chosen-select", tabindex = "1" })


@Html.LabelFor(m => m.CategoryId, new { @class = "label_intro" })
@Html.DropDownListFor(m => m.CategoryId,
new SelectList(Model.Categories.ToList(), "Id", "Name", Model.CategoryId), "All",
new { id = "patron-category", style = " width:300px", @class = "chosen-select", tabindex = "1" })

=============================================================
My Controller Method
=============================================================
C#
public ActionResult PatronBarGraph(FormCollection Form)
        {
            string patrontype = Form["patrontype"];
            string location = Form["LocationId"];
            string category = Form["CategoryId"];
            string ReportTypeTitle = string.Empty;

            string reportName = string.Empty;

            int locationId = Convert.ToInt32(location);
            int categoryId = (string.IsNullOrEmpty(category)) ? 0 : Convert.ToInt32(category);

            if (patrontype.Equals("ActivePatronsByRace"))
            {
                reportName = "PatronBarGraphByLC";
                ReportTypeTitle = "Active Patrons by Race Count";
            }

            else if (patrontype.Equals("InActivePatronsByRace"))
            {
                reportName = "PatronBarGraphByLC";
                ReportTypeTitle = "InActive Patrons by Race Count";
            }

            var rpt = new Services.Report.ReportService(reportName, null);
            var service = new PatronService(DataContext);

            if (patrontype.Equals("ActivePatronsByRace"))
            {
                rpt.ReportDocument.SetDataSource(service.GetRaceCountOfActivePatrons(locationId,categoryId));

            }
            else if (patrontype.Equals("InActivePatronsByRace"))
            {
                rpt.ReportDocument.SetDataSource(service.GetRaceCountOfInActivePatrons(locationId, categoryId));
            }

            rpt.ReportDocument.SummaryInfo.ReportTitle = string.Format("Bar Chart Report for {0}", ReportTypeTitle);
            return ReturnPDF(rpt.GetPDFStream(), reportName);

        }


==============================================================

I want to Show Location and Category Name on The Report For the Selection Criteria.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900