Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
javascript set html text value failed export
Jackie
Hi,<br />
<br />
I met a problem that when exporting report, there are some data did not exported.<br />
<br />
The unexported element is a Text, as html dynamic text. the code is following. when preview, it displayed, but can not exported while the text properties's allow export is true. <br />
Can someone give any advice, thanks firstly.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<span id="useTextId"></span>
<script type="text/javascript">
var use = '<VALUE-OF>params["use"].value</VALUE-OF>';
var useText = "1 page";
if(use == '2'){
useText = "2 page";
}else if(use== '3'){
useText = "3 page";
}else if(use== '4'){
useText = "4 page";
}
document.getElementById("useTextId").innerHTML = useText;
</script>
</pre>
<br />
p.s. I am working on birt4.2.0<br />
<br />
Regards<br />
Jackie
Find more posts tagged with
Comments
kclark
Previewing the report works but exporting it doesn't? What format are you trying to export to. Can you post your rptdesign?
Jackie
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="111797" data-time="1353613716" data-date="22 November 2012 - 12:48 PM"><p>
Previewing the report works but exporting it doesn't? What format are you trying to export to. Can you post your rptdesign?<br /></p></blockquote>
<br />
<br />
Hi kclark,<br />
<br />
Thanks very much.<br />
Your are right, when previewing the report works but exporting it doesn't, in any format such as PDF,excel or word. I have post my rptdesign file. pay attention to the "1 page" text in the below of first Grid, which's value is setted by javascript.<br />
<br />
Regards<br />
Jackie
Jackie
Hi kclark,
thanks very much.
I think I have find the way to solve the problem. I move the javascript to the text element's Script onPrepare, then it works and can be exported. the attach is my new rptdesign file. Maybe I can only put the javascript in the element Script.
Regards
Jackie