Binding the Style.BackgroundColor for a header panel to a Parameter

1 Answer 23 Views
Binding Expressions Report Designer (standalone)
Canice
Top achievements
Rank 1
Canice asked on 09 May 2025, 10:45 AM | edited on 09 May 2025, 11:51 AM

I'm using Telerik Reporting 2025 Q1 with the standalone Report Designer .NET.

I need to style my reports to match the background color of our application. I thought that using  a Parameter to pass in the color would be a solution, but I can't seem to bind it to the Style.BackgroundColor of the header panel.

I added an Integer parameter called ThemeColor with the value of a hex color (1445712).

First off, there is no editor support for binding for the value of the BackgroundColor (i.e. there is no dropdown menu to select expressions only different color pickets), but I can type in an expression manually. I'm not sure if this indicates that the BackgroundColor doesn't support expressions or it's a quirk of the editor).

I've tried entering =Parameters.ThemeColor, but it says that '=Parameters.ThemeColor is not a valid value for Int32.' 



I've also tried Parameters.ThemeColor.Value, but with the same error.

I've also tried =System.Drawing.Color.FromArgb(Parameters.ThemeColor), but the same error.

It only seems to accept named colors even through the documentation suggests that it should accept hex color.
https://docs.telerik.com/reporting/styling/styling-reports/styling-report-items

Thanks,
Canice

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 May 2025, 08:57 AM

Hi Canice,

Thank you for the screenshot and the additional information!

Indeed, the Style.BackgroudColor property does not resolve expressions which is what caused the warning about an invalid value being used when you tried passing the value of the report parameter.

To dynamically set the background color, you can instead use the "bindings" property - Bindings at a Glance - Telerik Reporting, for example:

Note that if you have many styles that you need to apply to the report to fit with the style of your application, it may be better to create a reusable stylesheet since you would otherwise need to apply the styling changes to each report individually that you create.

For details on how to import and export stylesheets, please visit the Exporting and Reusing existing Style Sheets - Telerik Reporting article.

I hope that the provided information and examples are helpful. Let me know if I can assist with anything else.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Binding Expressions Report Designer (standalone)
Asked by
Canice
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or