Showing posts with label font. Show all posts
Showing posts with label font. Show all posts

Monday, March 19, 2012

Dynamically set different font weight for each text in the textbox

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.

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.

|||

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.

|||

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<

|||

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<

|||

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.

|||

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.

|||

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.

|||


>>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<

Sunday, February 26, 2012

Dynamic way to change Font, Size, etc.

Hi,
I have one report format for 20 companies. Some of them require differnt
fonts and font sizes. I don't want to duplicate reports because they need
different font format. Is there a dymanic way to change font using one report
only? Thanks.
ChuckThere are two possible ways to do this:
1) Have your font settings in expressions that are populated by report
parameters or data. (It really works!) You can set default parameter
values.
2) Create a process that dynamically updates the RDL (report source) for
each company. This would mean inserting an extra step at either deployment
time or run time.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Chuck" <Chuck@.discussions.microsoft.com> wrote in message
news:3B1DF44A-14C7-4D90-B9D3-A3E67C913E0F@.microsoft.com...
> Hi,
> I have one report format for 20 companies. Some of them require differnt
> fonts and font sizes. I don't want to duplicate reports because they need
> different font format. Is there a dymanic way to change font using one
> report
> only? Thanks.
>
> Chuck|||Now I get some ideas to work on my project. Thanks so much for your reply.
-Chuck
"Jeff A. Stucker" wrote:
> There are two possible ways to do this:
> 1) Have your font settings in expressions that are populated by report
> parameters or data. (It really works!) You can set default parameter
> values.
> 2) Create a process that dynamically updates the RDL (report source) for
> each company. This would mean inserting an extra step at either deployment
> time or run time.
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "Chuck" <Chuck@.discussions.microsoft.com> wrote in message
> news:3B1DF44A-14C7-4D90-B9D3-A3E67C913E0F@.microsoft.com...
> > Hi,
> >
> > I have one report format for 20 companies. Some of them require differnt
> > fonts and font sizes. I don't want to duplicate reports because they need
> > different font format. Is there a dymanic way to change font using one
> > report
> > only? Thanks.
> >
> >
> > Chuck
>
>|||Another solution without having to add all those Parameters would be to
create a custom class that returns the font and font size etc. Then reference
the class in an expression. I have done this and it works great. Then you
could either distrubute a seperate class for each customer or have the class
read the information in from file and just distrubute a seperate file for
each.
See "Writing Custom Code" in the RS Help
Dave
"Chuck" wrote:
> Hi,
> I have one report format for 20 companies. Some of them require differnt
> fonts and font sizes. I don't want to duplicate reports because they need
> different font format. Is there a dymanic way to change font using one report
> only? Thanks.
>
> Chuck

Dynamic way to change font, font size, etc. in reports

Hi,
I have one report format for many clients. Some of them request different
fonts and font sizes. I don't want to duplicate reports because of differnt
fonts. Is there a dynamic way to change font or font size using only one
report format? Thanks.
ChuckChuck,
Custom code either embedded or as a custom assembly is the answer. This
article is a good starting point. http://odetocode.com/Articles/130.aspx.
Also, refer to the BOL for using custom assemblies.
You can use custom code to set font properties in your report.
"Chuck" wrote:
> Hi,
> I have one report format for many clients. Some of them request different
> fonts and font sizes. I don't want to duplicate reports because of differnt
> fonts. Is there a dynamic way to change font or font size using only one
> report format? Thanks.
>
> Chuck