tags:

views:

73

answers:

3

Is it possible to have 2 areas of text in one cell such that each can have a different color? You can do this in crystal reports but I cannot see a way to do this in ReportViewer. What it is doing is essentially highlighting an important text fragment if it appears in a cell description to draw the users attention. I am fairly new to reportviewer so it for now I am assuming it's my lack of knowledge that is making this difficult. I am using VS2010.

Thanks.

A: 

No, unfortunately not. I don't know if there are custom controls out there for ReportViewer, but the built-in TextBox only supports setting color (be it Foreground or Background) for the entire thing.

VicarInATutu
wow, that is really unfortunate. I guess this isn't ready for even small business reporting yet (my company has 75 employees).
BitFiddler
A: 

Turns out VicarlnATutu wasn't quite right.

You can do this, but only if you are using VS2010 (which I am) because it includes the new SSRS rendering engine for SQL-Server 2008. This allows you to put some basic HTML into a field and have multiple formats in one cell. For more info see below:

http://msdn.microsoft.com/en-us/library/cc645967.aspx

http://msdn.microsoft.com/en-us/library/cc627491.aspx

One thing that tripped me up is what they call a 'placeholder' in the MS documentation is the little bit of text inside the textbox control that shows up by default. You can select two different things on the control in VS2010. One is the textbox itself. Right clicking on the textbox gives you 'text box properties'. The other thing you can select is the default text INSIDE the textbox. Right clicking on this 'placeholder' text gives you a different context menu where you can select 'placeholder properties'. This is where you can change the cell to accept HTML.

BitFiddler
A: 

ah, good to know. kind of a unintuitive way to tell a TextBox to display HTML, but nice to know that you can!

VicarInATutu
I hear you on the 'unintuitive' thing. I kept seeing forum posts, tutorials and MS docs saying "Right Click on the Textbox Placeholder" and so I right clicked on the textbox. I thought that the textbox WAS the 'placeholder' for where the data would go. It was purely by accident that I noticed that the 'placeholder text' in the textbox did not contain the text I had put in there as an expression. This led me to think that right clicking on the text itself might do something.
BitFiddler

related questions