ReportViewer and ASP.NET MVC 3 - Razor

36 posts, 0 answers
  1. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Aug 2012 Link to this post

    Hi guys,

    We've updated the code library Using Telerik Web Report viewer in ASP.NET MVC application with an MVC 3 project using the Razor view engine. There is nothing new to add, it uses the approach of including a partial view with the web report viewer in a MVC 3 page.

    Regards,
    Steve
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  2. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 26 Mar 2013 Link to this post

    Hi all,

    Just a quick update: we will be working on a new web viewer for Q2 2013 which will work with MVC without the extra steps. Until then, check out our new blog + video on how to use Telerik Reporting in MVC 4.


    Regards,
    Vassil Petev
    the Telerik team

    Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

  3. DevCraft banner
  4. cheekl
    cheekl avatar
    55 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2013 Link to this post

    Hi,

    When the new web viewer for Q2 2013 is release? We are waiting for this Q2 2013 release.

    Thanks.
  5. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 27 Jun 2013 Link to this post

    Hello,

    We have rescheduled the release of the new viewer for Q3 2013. Meanwhile you can expect a preview of the feature to test it before the official release. If there are any changes they will be reflected in our Roadmap.

    Regards,
    Stef
    Telerik

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  6. Ed
    Ed avatar
    9 posts
    Member since:
    Jun 2010

    Posted 13 Nov 2013 Link to this post

    As an addendum, I recently need to pass some parameters to a report that was displayed from a ReportViewer in a partial (ASPX) page. It ended up being a fairly simple matter. Here's an example:

    // Controller code to display the View.
    public
    ActionResult ReportView(string id)
    {
        ViewBag.Title = "Parameterized Report";
        ViewBag.ReportViewName = "myparameterizedreport";
        ViewBag.ReportingParameters = new Telerik.Reporting.ParameterCollection()
        {
            new Telerik.Reporting.Parameter("CodeList", "232,249")
        };
        return View();
    }

    The ReportView.cshtml file:
    @{
        ViewBag.Title = ViewBag.Title ?? "Reports";
    }
    <link href="@Url.Content("~/Content/TelerikReportingFix.css")" rel="stylesheet" type="text/css" />
     
    <h2>@ViewBag.Title</h2>
     
    @* Include ASPX page that embeds the report viewer and identifies the data source. *@
    @Html.Partial((string)ViewBag.ReportViewName)

    And finally, the partial view that copies the parameters into the instantiated ReportViewer:
    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
     
    <%@ Register assembly="Telerik.ReportViewer.WebForms, Version=7.2.13.1016, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
     
        protected void ReportViewer1_Load(object sender, EventArgs e)
        {
            // Copy reporting parameters from the controller to the report instance.
            if (ViewBag.ReportingParameters != null)
            {
                foreach (Telerik.Reporting.Parameter p in ViewBag.ReportingParameters)
                {
                    this.ReportViewer1.ReportSource.Parameters.Add(p);
                }
            }
        }
    </script>
        <head id="Head1" runat="server">
            <title></title>
        </head>
        <body>
            <form id="form1" runat="server">
                <div>
         
                    <telerik:ReportViewer ID="ReportViewer1" runat="server" Width="100%"
                        Height="800px" onload="ReportViewer1_Load">
                        <typereportsource
                            typename="MyProject.Reports.MyParameterizedReport, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
                        </typereportsource>
                    </telerik:ReportViewer>
                </div>
            </form>
        </body>
    </html>

    In the definition of the CodeList report parameter, set Value to =Parameters.CodeList.Value to actually make the passed value available in the report.
  7. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 14 Nov 2013 Link to this post

    Hello,

    @Ed: Thank you for your examples.

    In addition, the new HTML5 Report Viewer is already released as of Telerik Reporting Q3 2013. More details about the new features can be found in the following help section:

    There are also examples in the local demos provided with your Telerik Reporting installation - C:\Program Files (x86)\Telerik\Reporting Q3 2013\Examples (the default installation folder).


    Regards,
    Stef
    Telerik

    New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Back to Top
DevCraft banner