title: How to set width for ReportViewer for MVC
body: <p>I am using <a href="https://www.nuget.org/packages/ReportViewerForMvc/">ReportViewer for MVC</a> to display a report in a view in my MVC application.<br>
  How do I set width for this control?  </p>
  
  <p>I have set the width to 100%, but it is not working, as can be seen in this screenshot.</p>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/s9Fpd.png"><img src="https://i.stack.imgur.com/s9Fpd.png" alt="image width"></a></p>
  
  <p>In my view I use:</p>
  
  <pre><code>&lt;div&gt;
      @Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { scrolling = "yes", width = "100%" })
  &lt;/div&gt;
  </code></pre>
  
  <p>And the the aspx page is:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body style="margin: 0px; padding: 0px;width:100%;"&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;div  style="width:100%"&gt;
  &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
  &lt;Scripts&gt;
  &lt;asp:ScriptReference Assembly="ReportViewerForMvc"     Name="ReportViewerForMvc.Scripts.PostMessage.js" /&gt;
  &lt;/Scripts&gt;
  &lt;/asp:ScriptManager&gt;
  &lt;rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%"  Height="600px"&gt;&lt;/rsweb:ReportViewer&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>