Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
master page dynamic column width
bbmuskie
Hi,
I've a grid inside the header in the master page. Based on the report parameter, how could I set the column width? Thanks.
i.e.
parameter "width" = 3 then grid's column 1 is 3cm
parameter "width" = 4 then grid's column 1 is 4cm
Thanks!
Find more posts tagged with
Comments
johnw
Couple of different ways.
If your just looking to set the grid width, you can use something like this in the onCreate:
if (params["NewParameter"].value)
{
this.width = "3px";
}
If you want to change the individual column widths, something like in in the onPrepare method would work:
if (params["NewParameter"].value)
{
var name = "gridToResize"; //give your grid a unique name so that findElement can find it.
var element = reportContext.getDesignHandle().findElement(name);
var column = element.getColumns().get(0); //get will get column X. You will need to iterate to set all column widths
column.setStringProperty("width", "3in");
}
In both the above examples, I am only using the parameters to determine if I need to resize or not. You can just as easily grab a value from a parameter and set it in the setProperty calls.