Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had to do it and so I worked for me :</p> <p>Suppose you have a controller called <strong>Summary</strong> . For this implementation, You don't need to add or modify any of the actions that you have.</p> <p>Then, as you told me, you add a file named "SkillReport.aspx" in your views folder</p> <pre><code> Views/Summary/SkillReport.aspx </code></pre> <p>( initially left in blank SkillReport.aspx or just add some text like "Skill report" )</p> <p>In Global.asax :</p> <pre><code> public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapPageRoute("Report", "Report/{rptController}/{rptName}", "~/Views/{rptController}/{rptName}.aspx"); ... } </code></pre> <blockquote> <blockquote> <p>****--> I have attached the snapshot of my solution explorer <img src="https://i.stack.imgur.com/izf5I.jpg" alt="enter image description here"> My routes.Mappageroute code is "<em>routes.MapPageRoute("Report", "Report/Summary", "~/Views/Summary/SkillReport.aspx");</em>" Please change the mapPageRoute for the above folder structure.** &lt;--</p> </blockquote> </blockquote> <p>The values ​​enclosed in <strong>{}</strong> are <strong>placeholders</strong>. You must not give the name of the controller or report there. When a request is received, this route determines which controller to invoke by adding the suffix "rptController" to the controller value in the URL to determine the type name of the controller that will handle the request. The <em>rptName</em> value in the URL determines which <em>WebForm.aspx</em> to call.</p> <p>Suppose you need other two reports. </p> <ol> <li>In <strong>Summary</strong> controller, and report name <em>FullNames</em></li> <li>In a controller named <strong>Product</strong>, and report name <em>List</em>.</li> </ol> <p>Using the parameters you avoid having to create a route for each report.</p> <pre><code>routes.MapPageRoute("Report", "Report/{rptController}/{rptName}", "~/Views/{rptController}/{rptName}.aspx"); http://localhost/Report/Summary/SkillReport --&gt; /Views/Summary/SkillReport.aspx http://localhost/Report/Summary/FullNames --&gt; /Views/Summary/FullNames.aspx http://localhost/Report/Product/List --&gt; /Views/Product/List.aspx </code></pre> <p>On this route we added:</p> <ol> <li><p>"Report" is the name of this route, you can put any other</p></li> <li><p>"Report/<strong>{rptController}</strong>/<em>{rptName}</em>" : This is the pattern URL to identify when to invoke your Report-WebForm, "Report" works as "key" and <strong>{rptController}</strong> is the name of the controller. rptController will be assigned with the Controller name. In this case <strong>Summary</strong> and <em>rptName</em> with <em>SkillReport</em></p></li> <li><p>"~/Views/<strong>{rptController}</strong>/<em>{rptName}</em>.aspx" is the physical path. When using this route with <strong>Summary</strong> controller, and call <em>SkillReport</em> this will invoke to Views/<strong>Summary</strong>/<em>SkillReport</em>.aspx</p></li> </ol> <p>Routing documentation: <a href="http://msdn.microsoft.com/en-us/library/cc668201(v=vs.100).aspx#url_patterns" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/cc668201(v=vs.100).aspx#url_patterns</a></p> <p>At this point you can verify that you can access your SkillReport.aspx in your development environment using :</p> <pre><code>http://localhost/Report/Summary/SkillReport </code></pre> <p>Or maybe at some particular port... like </p> <pre><code>http://localhost:1057/Report/Summary/SkillReport </code></pre> <p>Finally, SkillReport.aspx (like this... check ProcessingMode...)</p> <pre><code> &lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SkillReport.aspx.cs" Inherits="XXX.SkillReport" %&gt; &lt;%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" &gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=100"/&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="frmRpt" runat="server"&gt; &lt;div&gt; &lt;asp:ScriptManager ID="sm" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;rsweb:ReportViewer ID="rpt" runat="server" Width="100%" Height="90%" AsyncRendering="false" ProcessingMode="Local" ShowRefreshButton="false"&gt; &lt;/rsweb:ReportViewer&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>With this tag </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" &gt; </code></pre> <p>you achieve that show in Safari and other browsers.</p> <p>To access the report from a VIEW (.cshtml) need to add a link. i. e. :</p> <pre><code>&lt;a href="/Report/Summary/SkillReport" &gt;Show My Report :) &lt;/a&gt; </code></pre> <p>As a last comment, I recommend that after creating SkillReport.aspx enter in "<strong>Design Mode</strong>" and <strong>drag from the toolbox the Reporting's controls</strong>. This will automatically register the required values ​​in <strong>web.config</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload