Articles in this section

Dynamically Setting Table Cell Width Using Custom Property

Published:
Updated:

In Bold Reports, you can let readers change the width of a table cell while viewing a report by linking the Dynamicwidth custom property to a report parameter. The width updates at runtime, so no one needs to edit the report design. This article shows how to set up the Dynamicwidth property so a table cell takes its width from a parameter value.
Applies To:

  • Bold Reports Web Designer
  • Bold Reports Server
  • Bold Reports Embedded Reporting Tools (.NET Core, ASP.NET, Angular, React, Blazor)

Steps to Configure

1. Create a Parameter

  • Go to the Parameters panel and click New Parameter.
  • Name the parameter ColumnWidthParameter and set the Data Type to Integer. This is the name the expression in Step 4 refers to. If you choose a different name, use that name in the expression.
    New Integer parameter created in the Parameters panel

This integer value represents the width in pixels (px).

2. Select the Target Cell

  • In your report, select the table cell whose width you want to control dynamically.
    Table cell selected in the report design

3. Open Custom Attributes

  • Navigate to the Properties panel.
  • Expand the Miscellaneous section.
  • Locate Custom Attributes, click Set Attributes, and then click Add to create a new custom property.
    Set Attributes option under Custom Attributes in the Miscellaneous section

4. Add the Custom Property Details

  • Add a new custom property with the following details.
    Property Name:
    Dynamicwidth
    Property Name set to Dynamicwidth

Property Value (Expression):
=Parameters!ColumnWidthParameter.Value

Property Value set to the ColumnWidthParameter expression

5. Preview the Report

  • Enter a value for the parameter to set the width you want, for example 100. The report preview updates to use that width.

    Report preview with the parameter set to 100

  • Preview the report again with a different value, for example 250, to see the difference.

    Report preview with the parameter set to 250

Conclusion

Linking a custom property to a report parameter gives readers direct control over the width of a table cell, with no changes to the report design. It makes layout adjustments quicker and the report easier to adapt to different needs.

You can download a sample report here.

Related Articles
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied