Jump to content

Parameterizing fonts


jo_atman

Recommended Posts

This is the age-old question: how do i change the font used in the report dynamically? I have gone through the forum and found the following answers:

1. make as many lines as there are fonts and use printWhen to get the right font to print. This is a hack.

2. use a parameter or field to determine the font and change the <style> in the field. this one is still very cumbersome. if you have a hundred fields to show, putting the <expr> ? val1 : val2 with all the <style> stuff is tedious.

What's the laziest way to get this done :)

could i define <style>s at the beginning and then use the expression in 2. and switch between the styles?

Is there a cleaner way to do this through my datasource?

Thanks,

Nilesh

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

If you want to do it through the data source, then you can use the styled text functionality. In this case your text fields would contain markup and font information would be dynamic and embedded into them. Check the supplied /demo/samples/styledtext sample.

 

Another approach would be to dynamically alter the report template before using it for filling, just like we show in the supplied /demo/samples/alterdesign sample where we change the color of some elements.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...