<p>Using the viewer control for display of SQL Reporting Services reports on web page (Microsoft.ReportViewer.WebForms), can you move the View Report button? It defaults to the very right side of the report, which means you have to scroll all the way across before the button is visible. Not a problem for reports that fit the window width, but on very wide reports that is quickly an issue.</p>

[{'answer_id': 20781, 'author': 'Bryan Roth', 'author_id': 299, 'author_profile': 'https://Stackoverflow.com/users/299', 'pm_score': 2, 'selected': False, 'text': '<p>No, you cannot reposition the view report button in the ReportViewer control.</p>\n\n<p>However, you could create your own custom report viewing control.  The control would be comprised of fields for report parameters and a button to generate the report.  When a user clicks the button you could generate the report in the background.  You could display the report as a PDF, HTML, etc.</p>\n'}, {'answer_id': 886149, 'author': 'Liron Yahdav', 'author_id': 62, 'author_profile': 'https://Stackoverflow.com/users/62', 'pm_score': 3, 'selected': True, 'text': '<p>It\'s kind of a hack, but you can move it in JavaScript. Just see what HTML the ReportViewer generates, and write the appropriate JavaScript code to move the button. I used JavaScript to hide the button (because we wanted our own View Report button). Any JavaScript code that manipulates the generated ReportViewer\'s HTML must come after the ReportViewer control in the .aspx page. Here\'s my code for hiding the button, to give you an idea of what you\'d do:</p>\n\n<pre><code>function getRepViewBtn() {\n  return document.getElementsByName("ReportViewer1$ctl00$ctl00")[0];\n}\n\nfunction hideViewReportButton() { // call this where needed\n  var btn = getRepViewBtn();\n  btn.style.display = \'none\';\n}\n</code></pre>\n'}, {'answer_id': 1843548, 'author': 'Travis Collins', 'author_id': 30460, 'author_profile': 'https://Stackoverflow.com/users/30460', 'pm_score': 2, 'selected': False, 'text': '<p>The reason the button is pushed over to the right is that the td for the parameters has width="100%".  I\'m solving this problem with the following jquery.  It simply changes the width of the parameters td to 1.  Browsers will expand the width on their own to the width of the contents of the element.  Hope this helps.</p>\n\n<pre><code>&lt;script type="text/javascript"&gt;\n    $(document).ready(function() {\n        $("#&lt;%= ReportViewer1.ClientID %&gt; td:first").attr("width", "1");\n    });\n&lt;/script&gt;\n</code></pre>\n'}, {'answer_id': 27257819, 'author': 'PoppyIndicular', 'author_id': 4317302, 'author_profile': 'https://Stackoverflow.com/users/4317302', 'pm_score': 1, 'selected': False, 'text': '<p>Since I was searching for this answer just yesterday, I thought I\'d post what I came up with to solve our problem. Our reports were coming back wide, and we wanted the "view reports" button to exist on the left side of the control so there was no need to scroll to get to the button. I did need to go into the source of the rendered file to find the ID names of the button and the target table. </p>\n\n<p>I wrote a simple cut and paste javascript function to pull the button from its original position and essentially drop it into the next row in the containing table below the date pickers. </p>\n\n<pre><code>function moveButton() {\n  document.getElementById(\'ParameterTable_ctl00_MainContent_MyReports_ctl04\').appendChild(document.getElementById(\'ctl00_MainContent_MyReports_ctl04_ctl00\'));\n        }\n</code></pre>\n\n<p>This function gets called on the report viewer load event.</p>\n\n<pre><code>ScriptManager.RegisterStartupScript(Me, Me.GetType(), "moveButton", "moveButton();", True)\n</code></pre>\n\n<p>To adjust the position, I used the CSS ID. </p>\n\n<pre><code>#ctl00_MainContent_MyReports_ctl04_ctl00 {\n    margin: 0px 0px 0px 50px;\n}\n</code></pre>\n'}, {'answer_id': 52813948, 'author': 'Paul', 'author_id': 894995, 'author_profile': 'https://Stackoverflow.com/users/894995', 'pm_score': 0, 'selected': False, 'text': '<p>I had the same problem and ended up using an extension on Travis Collins answer; As well as changing the table column width I also align the "View Report" button left so that it appears neearer to rest of the controls.</p>\n\n<pre><code>    &lt;script type="text/javascript"&gt;\n  $(document).ready(function() {\n     $("#_ctl0_MainContent_reportViewer_fixedTable tr:first td:first-child").attr("width", "1"); \n     $("#_ctl0_MainContent_reportViewer_fixedTable tr:first td:last-child").attr("align", "left");   \n  });\n&lt;/script&gt;\n</code></pre>\n\n<p>You may need to tweak the JQuery selector depending on the element naming assigned to your existing control.</p>\n'}]
['https://Stackoverflow.com/questions/20744', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1215/']