Home » Archived » BIRT » How to Hide drill-through hyperlink information?(Do not show Drill-through hyperlink information)
| | |
Re: How to Hide drill-through hyperlink information? [message #777496 is a reply to message #777270] |
Tue, 10 January 2012 15:49 |
|
You can get a handle on all the <a> tags at run time using a script tag
in a text element, for example:
<script type="text/javascript">
//the function being added
function displaylayer() {
//alert("mouseover");
window.status='hello';
return true;
}
//this function adds the events
function changeLinks(){
var alinks = document.getElementsByTagName('A');
for (var i=0; i<alinks.length; i++) {
if (alinks[i].target == "_blank") {
//if IE
if(!window.event){
alinks[i].addEventListener('mouseover',displaylayer,false)
//otherwise
}else{
alinks[i].attachEvent('onmouseover',displaylayer)
}
}
}
}
changeLinks();
</script>
The issue with this is that most browsers have to be configured to allow
javascript to change the status bar.
Jason
On 1/10/2012 2:21 AM, Bruce Mising name wrote:
> Thanks for your reply reference.
>
> I downloaded the example, with JS to set tag:<a> href value is fine, and the URL information is OK.
> the example code:
>
>
> But there is one more question:
> In my case, I used "Drill-through" and passed Cell's value to child report. The url hyperLink information is auto generated by render report.
> It seems that I can't rewrite tag A's href value.
>
> my drill-through report's code pieces:
> <extended-item extensionName="CrosstabCell" id="167">
> <property name="content">
> <data name="ASSIGNEE" id="168">
> <property name="fontFamily">"宋体"</property>
> <property name="fontSize">12pt</property>
> <property name="fontWeight">bold</property>
> <property name="textAlign">center</property>
> <method name="onPrepare"><![CDATA[this.width = "150px";]]></method>
> <property name="resultSetColumn">ASSIGNEE</property>
> <list-property name="action">
> <structure>
> <property name="linkType">drill-through</property>
> <property name="toolTip">"test tool tips"</property>
> <property name="reportName">workDetail.rptdesign</property>
> <property name="targetWindow">_blank</property>
> <property name="targetFileType">report-design</property>
> <list-property name="paramBindings">
> <structure>
> <property name="paramName">processKey</property>
> <simple-property-list name="expression">
> <value type="javascript">params["processKey"].value</value>
> </simple-property-list>
> </structure>
> <structure>
> <property name="paramName">startTime</property>
> <simple-property-list name="expression">
> <value type="javascript">params["startTime"].value</value>
> </simple-property-list>
> </structure>
> <structure>
> <property name="paramName">endTime</property>
> <simple-property-list name="expression">
> <value type="javascript">params["endTime"].value</value>
> </simple-property-list>
> </structure>
> <structure>
> <property name="paramName">userName</property>
> <simple-property-list name="expression">
> <value type="javascript">data["ASSIGNEE"]</value>
> </simple-property-list>
> </structure>
> </list-property>
> </structure>
> </list-property>
> </data>
> </property>
> <property name="verticalAlign">middle</property>
> </extended-item>
>
> How should I do to hide the gernerated reports' hyperlink information?
> to be more suitable show like "javascript: openwindow('some pass value')"
>
> Regards,
> Bruce
|
|
| |
Re: How to Hide drill-through hyperlink information? [message #778287 is a reply to message #778011] |
Thu, 12 January 2012 07:39 |
Bruce Missing name Messages: 5 Registered: May 2011 |
Junior Member |
|
|
Hi, Jason
Thanks for your help. My problem has done, by used a text element with <JavaScript> function codes to set hide <a> tag, without use of drill-through.
Under is my tested JS codes in the text element.
<html>
<head>
<title>Simple Test</title>
<script language="javascript">
function openwindow(val)
{
window.open("/nmcms/frameset?__report=customerDetail.rptdesign&__format=html&customName="+val,
"myWindow",
"menubar=no,toolbar=no,personalbar=no,location=no,resizable=yes,scrollbars=yes,status=no");
}
</SCRIPT>
</SCRIPT>
<P>
<A href="javascript: openwindow('<VALUE-OF>dimension["Group1"]["CUSTOMERNAME"]</VALUE-OF>')">
<VALUE-OF>dimension["Group1"]["CUSTOMERNAME"]</VALUE-OF>
</A>
In my opinion, if the "drill-through" supply an option to set hyperlink show detail would be better
Looking forward to your suggestion.
Regards,
Bruce
|
|
|
Re: How to Hide drill-through hyperlink information? [message #778403 is a reply to message #778011] |
Wed, 11 January 2012 18:30 |
|
Bruce,
The actual hyperlinks are generated by a Java class. You could change
the html action handler class, but that would require changing your
distribution. If you look at your crosstab with the customer name you
could always delete your data item and use a text element like:
<a href="http://www.google.com" onmouseover="window.status='';return
true"><VALUE-OF>data["CUSTOMERNAME"]</VALUE-OF></a>
I tried this but the status still showed. If you have sensitive
variables you may want to use session variables instead of parameters.
For example you could store a session variable in one report like:
//on create
reportContext.getHttpServletRequest().getSession().setAttribute("tst",
this.getValue());
destination report
var mytst =
reportContext.getHttpServletRequest().getSession().getAttribute("tst");
Jason
On 1/11/2012 4:37 AM, Bruce Mising name wrote:
> Hi, Jason
>
> Thanks for your suggestion.
> I tested your given functions, by add this function into one JSP pages, when mouseover<a> tag the link info can be hide.
> I tried put JS function into one text element, but it does not work so.
> Maybe I misunderstand your advice :? . and I submit my test example(see file attachments), Please take some time to see it.
>
> My environment like follow:
> version:BIRT 3.7
> view servlet: frameset
>
> One more question:
> I wonder is there some way to generate hidden<a> tags. By override the report's render handlers to generate myself<a> tags.
> For example: generate<a> tags like this could be void to display on status.
> <a herf="" onmouseover="window.status='';return true" />
>
> I think this could be the direct way. But I don't know which handler should be override?
> In my example, I used a Data Cube, and passed the CrosstabCell value to child report.
> can you tell me which handler should I extends and override?
> an override handler example could be much more better :)
>
> Regards,
> Bruce
|
|
|
Re: How to Hide drill-through hyperlink information? [message #778408 is a reply to message #778287] |
Thu, 12 January 2012 15:59 |
|
Bruce,
The solution you came up with is a good one. It would be good to log an
enhancement in bugzilla to hide the status or obfuscate the url in drill
throughs.
Jason
On 1/12/2012 2:39 AM, Bruce Mising name wrote:
> Hi, Jason
>
> Thanks for your help. My problem has done, by used a text element with
> <JavaScript> function codes to set hide <a> tag, without use of
> drill-through.
>
> Under is my tested JS codes in the text element.
> <html>
> <head>
> <title>Simple Test</title>
> <script language="javascript">
> function openwindow(val)
> {
> window.open("/nmcms/frameset?__report=customerDetail.rptdesign&__format=html&customName="+val,
>
> "myWindow",
> "menubar=no,toolbar=no,personalbar=no,location=no,resizable=yes,scrollbars=yes,status=no");
>
> }
>
> </SCRIPT>
> </SCRIPT>
> <P>
> <A href="javascript:
> openwindow('<VALUE-OF>dimension["Group1"]["CUSTOMERNAME"]</VALUE-OF>')">
> <VALUE-OF>dimension["Group1"]["CUSTOMERNAME"]</VALUE-OF>
> </A>
>
> In my opinion, if the "drill-through" supply an option to set hyperlink
> show detail would be better :) Looking forward to your suggestion.
>
> Regards,
> Bruce
|
|
| |
Goto Forum:
Current Time: Fri Mar 29 15:38:36 GMT 2024
Powered by FUDForum. Page generated in 0.02670 seconds
|