Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Dynamic Text - HTML- Stripped/Allowed tag
Migrateduser
<p>I am trying to put some SVG into a 3.7.2 BIRT report. As BIRT reports output is HTML 4.01 Transistional this can still be valid as long as the SVG's correct namespace is included. This works on most modern browsers. To add it in I am using the dynamic text element set to HTML and then setting the contents to calculate the SVG as required. When I run the report the SVG tags are stripped. Other HTML tags such as surrounding div tags are not stripped.</p>
<p> </p>
<p>The only way I have been able to get this to work is to convert the SVG to HTML encoded text so it appears as text in the output and have this surrounded by div tags with the class "svg". Then use a script tag containing javascript, that is added to the end of the report, that looks for these div tags and extracts the text and then replaces each div's innerHTML with its text.</p>
<p> </p>
<p>This works but has the side-effect of the user seeing the raw SVG appear in the report (particularly if it is a long and hence slow report) until it gets the bottom to the above mentioned script for this SVG text to change into the actual SVG. Due to this side-effect I would rather not do it this way so I am looking for a better solution.</p>
<p> </p>
<p>I assume the BIRT Report Engine sanitises the HTML using a list of allowed HTML tags and strips any that are not this list; and it does this for security reasons.</p>
<p> </p>
<p>Is there any way to stop the SVG tags from being stripped? If my assumption of the list is correct is there anyway to modify this list?</p>
<p> </p>
<p>Paul Cooper</p>
Find more posts tagged with
Comments
There are no comments yet