I recently encountered an issue with the SSRS ReportViewer control where the parameter drop-down list was of insufficient width for the parameters contained therein. Surprisingly, a search yielded no solutions. Indeed, several individuals indicated that changing this width was not possible.
Fortunately, it does turn out to be possible.
Firing up the IE developer toolbar, I immediately noted that (a) parameter controls were rendered outside the document hierarchy (in this case at the end of the FORM), (b) there was no class specified anywhere within the internal ReportViewer tag hierarchy, and (c) styles were hard-coded directly on the DIV tag which held the drop-down list (implemented as a TABLE). Indeed, the width attribute on this DIV was hard-coded at 184px. By default, the parameters dropdown appears as:
Fortunately, while there was no specific class to hang a custom width from, it turns out that the id of this DIV was reliably predictable. As such, a judiciously constructed style could indeed target (and thereby style) this tag.
The form of the id on the DIV in question is [Viewer ClientId]_ctl00_ctl03_divDropDown. Here, ctl00 is the automatically-generated id of the Microsoft.Reporting.WebForms.ParametersArea control, and ctl03 is the id of the Microsoft.Reporting.WebForms.MultiValueValidValuesControl.
Putting this together, an initial style would read as:
DIV#<%= Viewer.ClientID %>_ctl00_ctl03_divDropDown
width: 320px !important;
<rsweb:ReportViewer ID=”Viewer” runat=”server” Width=”100%” Height=”600px” ProcessingMode=”Remote” />
Here we use the ClientID the ReportViewer (and its constituent ctl00 and ctl03 child and grandchild, respectively). We also use an “!important” declaration to override the inline styling. After our style is applied, the ReportViewer dropdown may be set to any size.
Note that it would be of better form to create a custom function that recurses the ReportViewer control hierarchy to locate the divDropDown control (and use its ClientID). This would make the solution a bit more forward-looking and upgrade-friendly. I leave this as an exercise to the reader (there are plenty of tutorials out there about recursing the control tree).
Hope this helps anyone needing to resize this particular control.