Welcome to MSDN Blogs Sign in | Join | Help

How to create an inline bar chart

Here's a neat trick a co-worker and I discovered this afternoon for creating an inline bar chart (an inline data visualization in a table or other data region).

1. Add an embedded image to your report that will serve as the "bar" (a simple horizontal gradient usually looks nice)

2. Add a column to your table, and place an Image report item in the detail row cell.

3. Select the embedded image from step 1 as the source for the Image report item.

4. Set the padding on the Image report item to adjust the size and position of the bar within the cell

5. [Here's the kicker] Create an expression for the right (or left) padding that divides a field value by some maximum value, clamps it to a given range if necessary using Math.Min/Max, and then multiplies by the total size of the bar.

Example: image1.Padding.Right=((1.0-(Math.Min(Math.Max(Fields!TotalSales.Value,0),100000)/100000))*72) & "pt"

Published Saturday, October 15, 2005 6:44 AM by bobmeyers
Filed under:

Comments

# How to set background color gradient to my report name textbox

Thursday, May 11, 2006 3:29 PM by bvramana2007
I wonder if there is a possibility to add background color gradient to any text box like in css styles: style="width: 100%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#DBCF23,EndColorStr=003399)"
Anonymous comments are disabled
 
Page view tracker