Vaccano
Vaccano

Reputation: 82291

SSRS 2008 partial string formatting

Say I have a data field (call it Results.MyString) that looks like this in a text box in my report:

Some text here for all to read.

Also, say that I have a data field (call it Results.MyParam) that has this value:

here

Is there a way to conditionally format the text box so that it would search Results.MyString for any matches to Results.MyParam and change the color of them?

The end result would have the word "here" be a different color (ie Red), but the rest of the text in the text box be Black.

Upvotes: 2

Views: 1276

Answers (2)

TonBill
TonBill

Reputation: 513

Two parts to the answer. 1. Hook into the code window by opening the Report parameters Code tab. Place your functions in the code window. 2. You can make a textbox expression placeholder react to HTML tags by enabling that property on the expression placeholder. (You can Google 'ssrs placeholder expression' for specifics.)

Your function could parse the text, find target string, dynamically surround the target with the appropriate HTML color tags and return the expression to the textbox.

Upvotes: 1

Kunal
Kunal

Reputation: 26

Selected Text is what you are looking for.

Upvotes: 1

Related Questions