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)
[BIRT 2.2.2] Change theme by script
alex71
Hello,
I created 2 themes in a library and I wish change theme using initialize script of the report.
I tested this script
{
if ( params["num_clt"] == 1 )
report.design.setUserProperty("theme","CusRep.Rating");
else
report.design.setUserProperty("theme","CusRep.Dcon");
}
but I had this error
org.eclipse.birt.report.model.api.command.UserPropertyException: The user property with the name "theme" already exists.
at org.eclipse.birt.report.model.command.UserPropertyCommand.addUserProperty(UserPropertyCommand.java:81)
at org.eclipse.birt.report.model.api.DesignElementHandle.addUserPropertyDefn(DesignElementHandle.java:687)
at org.eclipse.birt.report.model.simpleapi.DesignElement.addUserProperty(DesignElement.java:119)
at org.eclipse.birt.report.model.simpleapi.DesignElement.setUserProperty(DesignElement.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Thanks for everyone's help!
Alexandre
Find more posts tagged with
Comments
mwilliams
Hi Alexandre,
Try the following in your report:initialize method:
reportContext.getReportRunnable().designHandle.getDesignHandle().setProperty("theme", "My_Theme");
alex71
Hello,
Thank you very much
It's good !!!
Alexandre