try
{
final ReportContext reportContext = runtime.getReportContext();
final ReportStructureRoot root = reportContext.getReportStructureRoot();
final ResourceKey baseResource = root.getBaseResource();
final ResourceManager resourceManager = root.getResourceManager();
final byte[] bytes = styleText.getBytes("UTF-8");
final ResourceKey key = resourceManager.createKey(bytes);
final Resource resource = resourceManager.create
(key, baseResource, StyleRule.class);
final CSSDeclarationRule parsedRule =
(CSSDeclarationRule) resource.getResource();
mergeDeclarationRule(targetRule, parsedRule);