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)
How to modify generated HTML - (add attributes to elements)
netname
I wan to add some attributes to certain elements of a HTML report generated by Birt. Specifically on the body element of the generated HTML.
Is there a way to handle this withing Birt Designer or the Birt tools or should I modify the generated html with other tool?
Thanks,
Find more posts tagged with
Comments
JasonW
You can modify some of the attributes using the fragment jsp pages. You can also use javascript within a text element to make certain modifications. Can you give more detail on what you need?
netname
I want to "silent print" a report. Googling around I found that it is not reliable to "silent print" a PDF so I am doing it for a Html report.
As you suggest I used JSP to create the report. The issue is that now I had to deploy Webviewer.
I would like to find a way to either:
1) Scan the generated HTML and make changes as part of report generation
2) Specify how certain parts of the report <HEAD> <BODY> are to be generated while designing the report.
Thanks,
JasonW
I do not know of a way to scan the generated html inside of BIRT. I am not certain that the silent print will run javascript, but you could add a text element to the report, set its type to html and get access to the body/header elements using a similar script to this:
<script language="javascript">
function bodyX()
{
var x= document.getElementsByTagName("body" )[0];
alert( x.innerHTML );
}
bodyX();
</script>
Jason
netname
Thanks Jason. I really appreciate your help. As always, the project got bigger so I will be using the Webviewer after all.
Thanks again.
TheRealDea
I kind of have an addendum to the original post. Say I have a text control w/HTML option enabled and the following as the code:
<FORM name="nameForm">
Name:
<INPUT TYPE=TEXT NAME="txtName">
</FORM>
How would I get the "txtName" value out of "nameForm" form from another BIRT process? Say for example, I would like to be able to get this value at the point of a hyperlink/drill-through/parameter as the value to pass along to a subsequent report as a parm?
Or could one possibly place this value in a report parameter once the it is entered into the HTML?
Thank you,
TheRealDea
Does anyone have a suggestion on how to get the value out of the HTML from another process in BIRT?
JasonW
Since the form is processed client side the BIRT processes can not use it. You could use this to construct your own drill through though. To get the value, just add another text element with some script. For example modify your form to look like:
<FORM name="nameForm">
Name:
<INPUT TYPE=TEXT id="txtName" NAME="txtName">
</FORM>
And then add a text element below this that looks like:
<script language="javascript">
function getFormValue()
{
var x= document.getElementById("txtName" ).value;
alert( x );
}
</script>
<INPUT Type="BUTTON" name="mybutton" value="Click to Get Value" onClick='getFormValue()'></INPUT>
Jason
TheRealDea
One other thought then -- would it be possible to use this HTML in some fashion to push the value into a BIRT parameter? This option might also suffice.