in

Prologika Forums

Business Intelligence to the Masses

This Blog

Syndication

News

Visit prologika.com for information about Teo's publications, the latest on the Microsoft Business Intelligence initiative, and more...

Prologika (Teo Lachev's Weblog)

Teo Lachev is a consultant, mentor, and author focusing on the design and development of Microsoft .NET business intelligence solutions. Read about Teo's work and life. Registered users can post comments.

Tricksy Parameter Prompts

Q: How to make the darn parameter drop-down list wider in HTMLViewer? HTMLViewer is the Report Manager control that displays the report when you view the report.

A: HTMLViewer supports limited customization via a CSS stylesheet.

  1. Copy HTMLViewer.css to MyHTMLViewer.css in the same folder (Reporting Services\ReportServer\Styles). Note that the actual folder path varies between SQL Server versions.
  2. Add the following CSS style to MyHTMLViewer.css

SELECT {

font-size: 8pt;

font-family: Verdana;

width:200px

}

As a result, all SELECT elements on the page (all dropdowns, such as parameter prompts, zoom, export) will pick up these settings.

  1. Configure the server to use the custom stylesheet by one of these options:
    1. If you want to apply the custom styles to all reports, add a new HTMLViewerStyleSheet element to the rsreportserver.config file, such as:

<Configuration>

...

<HTMLViewerStyleSheet>MyStyleSheet</HTMLViewerStyleSheet>

...

</Configuration>

Note that due to an unfortunate bug, the HTMLViewerStyleSheet setting doesn't work with February CTP of SQL Server 2008 but it will be fixed in the final release.

  1. Use the rs:Stylesheet device setting to apply the custom style to given report only, such as:

http://localhost/ReportServer?/AdventureWorks Sample Reports/Product Line Sales&rs:Command=Render&rc:Stylesheet=MyStylesheet

Comments

 

Microid said:

Hi. Thank you for your lightning response :)

Is is possible to use multiple css files?

That way i can keep all current css classes and settings and just "add" this one?

April 21, 2008 2:50 PM
 

Microid said:

I'm afraid this solution has no effect...I did exactly as you instructed but nothing has changed in the parameters fields.

April 22, 2008 2:23 AM
 

Microid said:

what i do notice is that some of the fields did grow wider, but only those who now have the "<Please select a value>" on them in the beginning...where did that come from ? :)

April 22, 2008 3:08 AM
 

Microid said:

some of the parameters are dependant.those who are not dependant are affected by the change (they have "<please select a value>" on them in the beginning...is the css class for dependant parameters different somehow?

April 22, 2008 3:12 AM
 

saggi said:

Hi,

Interesting post!

I tried setting the direction attribute (for body) to rtl (right-to-left, for langauges such as hebrew and arabic) in order for the parameter inputs to show from right to left, but to no avail.

Do you know if it's possible to do it with CSS in SSRS?

April 22, 2008 10:23 AM
 

tlachev said:

All SELECT elements in the HTML viewer should pick up these settings.

April 23, 2008 8:10 AM
 

tlachev said:

Saggi,

I don't know. I don't know CSS that well. If CSS can do it, I don't see any reason this won't work with SSRS.

April 23, 2008 8:11 AM
 

tlachev said:

Microid,

You can have as many CSS files as you want but the report link can use only one.

April 23, 2008 8:12 AM
 

davidtg said:

Thank you for noting the issue with Feb release of RS2008. I've spent 2hrs trying to figure out why my custom css wasn't working with it.

May 15, 2008 3:06 PM
Copyright © 2005 Prologika, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems