Dynamically adjust the font size of the report based on the incoming parameters.

1 Answer 77 Views
General Discussions
Jackson
Top achievements
Rank 1
Iron
Iron
Jackson asked on 05 Aug 2024, 07:51 AM

Hi,

I want to pass parameters to the report so that the font size in the Style of the report can be set according to the content of the parameters. For example, if the parameter ReportFontSize=9, then the font size of the content in the Label control and Table control in the report will be 9pt. Is there a way to achieve this currently?

1 Answer, 1 is accepted

Sort by
1
Accepted
Dimitar
Telerik team
answered on 07 Aug 2024, 01:26 PM

Hello Jackson,

Yes, I confirm that it is possible to change the font size dynamically depending on the value of a Report Parameter.

To achieve this, you may use a binding on the Style.Font.Size property, for example:

However, the type of unit must be included in the value passed to the report parameter. What I mean by this is that instead of passing the value 9, you may instead pass 9pt as the value of the report parameter.

Where this binding will be applied depends on the item hierarchy. For example, if you add the above binding to a table, all of its child items such as the textbox items in the table cells will have the same font size(unless the item has explicitly defined font size). Likewise, if the above binding is applied at the report level, all items that do not have a specified font size will use the font size provided with the binding.

For more information on the topic, you may refer to the Report item style properties - Telerik Reporting article.

I hope this will help.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Jackson
Top achievements
Rank 1
Iron
Iron
commented on 21 Aug 2024, 01:20 AM

thanks
Tags
General Discussions
Asked by
Jackson
Top achievements
Rank 1
Iron
Iron
Answers by
Dimitar
Telerik team
Share this question
or