views:

469

answers:

2

I'm using Microsoft Report Viewer in windows application and its datasource is a custom class object. I have several Text fields and some are in different formats (ie size of the font, underline, bold....) but several are grouped.

For these reason I would like to use a CSS (Cascading Style Sheet) class or some thing similar for formatting. (now I formatting each controls manually).

Is there a way to do this?

A: 

I don't believe you can use CSS for a desktop windows application, your best bet is to look at the custom formatting for each cell of the ReportViewer

firedrawndagger
A: 

No, there is no way to do this. RDL, and all of the tools built around it (like ReportBuilder, BIDS, etc) have no concept of stylesheets of any kind.

The best solution is to select all the textboxes at once that you want all to be the same, then edit their properties in the property grid (in BIDS, Visual Studio or ReportBuilder). If you instead edit their properties through the property dialog, you must do it one at a time.

Matt Greer
Alternately, there are libraries out there that let you define RDL in code instead of XML. Or there are also ways of having Visual Studio generate a library for you against RDL's schema. If you did that, you could define subclasses of your own and basically create your own stylesheet system. But that's a lot of work.
Matt Greer