Shanthi Raghavan


Hi friends,

I have a text box with n number of text.

I want to set the font weight of each text in the textbox dynamically..

For eg.. suppose the text of the textbox is "Hello Friends", then i need "Hello Friends" as output.

Is there any way to accomplish this in SQL Reporting Service.

Any help will be appreciated. Its critical.

Please help me out ASAP.




Re: Dynamically set different font weight for each text in the textbox

sluggy


No, the font settings are per textbox, so everything in the textbox will have the same font weight. You can use different textboxes, but that ends up pretty messy.






Re: Dynamically set different font weight for each text in the textbox

GregSQL

Yes it is possible. However, it is not easy and you will need Visual Studio 2005 to do it.

It sounds like you are basically wanting to change the layout of the report at runtime.

Here is how to do it:

http://msdn2.microsoft.com/en-us/library/ms170667.aspx

After you are able to change the layout of the report at runtime, you will want to deploy the report from your application using SetReportDefinition.







Re: Dynamically set different font weight for each text in the textbox

Lisa Nicholls

Greg, are you thinking that he would create a separate textbox for each wordin the original textbox to handle this requirement, so that each one would have its own formatting How would that work, for different instances of the same textbox in the report (for example, the first one reads "this is my text" and "is" should be bold, but the second instance reads "this is not really my text" and the word "my" should be bold

Also I think the positioning/kerning would be a nightmare...

>L<






Re: Dynamically set different font weight for each text in the textbox

Lisa Nicholls

The only way I know how to do this successfully in Reporting Services (although Greg may have another approach, I'm not seeing it!), is to do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<






Re: Dynamically set different font weight for each text in the textbox

GregSQL

Lisa Nicholls wrote:

The only way I know how to do this successfully in Reporting Services (although Greg may have another approach, I'm not seeing it!), is to do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<

This sounds like a better approach. I suppose I was thinking that you could change the font weight per word.






Re: Dynamically set different font weight for each text in the textbox

Shanthi Raghavan

Thanks Lisa and Greg for the answers .. I am sorry to reply late.. I was trying out lisa's solution.

But my scenario is different. I have a text bos and the expression of my textbox is as follows:

="Dear"+" "+Ucase("Robert")+space(2)+vbcrlf+"How are you"

where "vbclrf" is for new line and "space(2)" is for leaving 2 spaces between the text and "Ucase" stands for upper case.

Similarly I need a way to display the text "Robert" in bold letters.

Do you have any suggestion for this.





Re: Dynamically set different font weight for each text in the textbox

GregSQL

Lisa Nicholls wrote:

...do some custom rendering. IOW, if you render the information yourself, you are free to set the formatting for each word in the text. The result becomes a small graphical "piece" in the report, though, not really text. So it wouldn't be searchable text.

If this solution appeals to you at all, I can give you more details.

>L<

It still sounds like this is what you need.






Re: Dynamically set different font weight for each text in the textbox

Lisa Nicholls


>>But my scenario is different.

No, really, it's exactly what I thought. If you tried what I suggested... what exactly did you try

In the current version of RS, what you need to do is build a function that parses your markup in a

CustomReportItem, and renders the content appropriately for your markup.

In the next version of RS (Katmai -- there is a thread post about rich text) you might have a

better choice, from the point of view of rendering. IOW, you would not have to use a

CustomReportItem for this. However, given your custom markup, you would still have to create a

code function to parse the markup and put it in a more standard form, such as HTML markup or RTF

or whatever Katmai supports, so that the standard rendering could deal with it.

For this reason, I strongly suggest you think about switching to a standard markup format that

standard renderers, whether in RS or elsewhere, could read! Your users and designers will also

thank you for it.

>L<