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)
Full path to report is displaying on bottom browser bar
mmacmillan74
<p>When navigating to a drill-down report (hovering over sub-link), the absolute path is shown on the bottom bar of browser. From the toolbar link it is not. Just drill-down. Any way to suppress this or just show the relative path? This is causing security concern.</p>
<p> </p>
<p>Thanks!</p>
Find more posts tagged with
Comments
mmacmillan74
<p>Any ideas guys?</p>
JFreeman
<p>What version of BIRT are you using?</p>
<p> </p>
<p>I believe this is happening because the hyperlink for the drill down is created as an anchor tag with an href which will be displayed as you have indicated in most modern browsers.</p>
<p> </p>
<p>From what I can find, there does not appear to be a way to force the browser to not display this for an href in an anchor tag.</p>
<p> </p>
<p>Instead, you can use client side javascript to remove the href from the anchor inside the divs and then add an event listen function to execute the hyperlink instead.</p>
mmacmillan74
<p>2.5.1.</p>
<p> </p>
<p>Can you be a little more specific? I get the gist of what you are saying, but don't know where the hyperlink is created like this and where I would put the javascript.</p>
<p> </p>
<p>Thanks for replying</p>
JFreeman
<p>Take a look at the example I've attached.</p>
<p> </p>
<p>I use client side javascript in a text element after the table to hook the anchor tags with the drill through links in the DOM tree and replace the href with an event handler that opens the link instead. With the event handler, the URLs for the drill through are no longer exposed.</p>
<p> </p>
<p>In 2.5.1 this will work when the report is displayed in HTML but it isn't going to work with the web viewer. However, it will work in the web viewer in newer versions.</p>
mmacmillan74
<p>Thanks for the example...really appreciate that. Unfortunately, we need this in the web viewer (Viewer and Engine servlets). Anyway in 2.5.1 to do that or do we need to upgrade? Will any of the web.xml parameters help?</p>
<p> </p>
<p>Again...really appreciate it.</p>
JFreeman
<p>For this particular method within the report design, you will need to upgrade to get it working in the Web Viewer.</p>
<p> </p>
<p>Either way, I would really recommend looking towards upgrading, 2.5.1 is rather old at this point.</p>
<p> </p>
<p>If there is another way to get into the DOM tree client side in the report that should work but i'm having trouble find a way to get that done from within the report design in 2.5.1.</p>
<p> </p>
<p>How are you generating/displaying the reports in your application?</p>
<p> </p>
<p>You may be able to add a call back function after the report is generated in your application and add the code from my example into the call back to get into the DOM tree instead of doing it from within the report design.</p>
<p> </p>
<p>The one issue with going that route is you will need to come up with a system to know what the correct div id is to hook as I am setting a bookmark within the report design which is how I hook the div to start making changes.</p>
mmacmillan74
<p>Seems like a lot of work when we are planning on upgrading at a later point.</p>
<p> </p>
<p>I appreciate your feedback!</p>
JFreeman
<p>I do not disagree.</p>
<p> </p>
<p>I think the best option would be to upgrade before going down the path of putting something in place to override the href in the anchor tag for the drill-through.</p>
mmacmillan74
<p>Sorry to resurrect an old post but is there an example of "<span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">You may be able to add a call back function after the report is generated in your application and add the code from my example into the call back to get into the DOM tree instead of doing it from within the report design." Is this a reportviewer call back or a filter you are referrencing.</span></p>
Clement Wong
<p>Are you still using BIRT 2.5.1?</p>
<p> </p>
<p>How are you deploying your application?</p>
mmacmillan74
<p>Yes unfortunately we are. It will take too much effort and hours to get approved to go to latest version. We are trying to fix this in 2.5.1 for now until we upgrade. We use the EngineServlet and ViewerServlet in the web.xml. We then put all the jars in the lib folder in web-inf. We use the frameset with parameters. The security issue is the full path is shown on the drill down hover. I have all of your source code in my MyEclipse workspace so I can step through the debugger. I can put a debug point anywhere in your code. I see how it is built with the frameset fragments include statements. Just can't figure out how to get the dang hover over to change :-) I wish there was an easy way or someone from Actuate to tell me how to implement that. I did see the parameter WORKING_FOLDER_ACCESS_ONLY and saw in the ViewerHTMLActionHandler>>buildDrillAction that if it is false it uses the working directory, but when hover over still showing full path.</p>
<p> </p>
<p>Does anyone have any clever tricks up their sleeves to help me out?</p>
Clement Wong
<p>Here is a workaround for 2.5.1, and should be modified as needed for your environment.</p>
<p> </p>
<p>In <strong>FramesetFragment.jsp</strong>, under <em><birt viewer app path>\webcontent\birt\pages\layout</em>, you can add this script before </HTML>.</p>
<p> </p>
<p>It's a slight variation of Jesse's solution (instead in the report), to have it as part of the viewer fragment.</p>
<pre class="_prettyXprint">
<script>
hrefs = [];
setTimeout(function(){
var nodesToReplace = document.getElementById("custn").parentNode.parentNode.parentNode.childNodes;
var linknum = 0;
for(var i=2; i<(nodesToReplace.length-2); i++){
var node = nodesToReplace[i].childNodes[1].childNodes[1].childNodes[1];
hrefs.push(node.href);
node.href='javascript:void(0);';
node.name = linknum;
node.onclick = function() {
window.location = hrefs[this.name];
};
i++;
linknum++;
}
}, 1000);
</script></pre>
mmacmillan74
<p>Doesn't</p>
<p> </p>
<p><span>document</span><span style="color:rgb(102,102,0);">.</span><span>getElementById</span><span style="color:rgb(102,102,0);">(</span><span style="color:rgb(0,136,0);">"custn"</span><span style="color:rgb(102,102,0);">)</span></p>
<p> </p>
<p>mean that each element that has a drilldown hasto be named "custn" ?</p>
Clement Wong
<p>That was the solution that Jesse proposed in his example with <span style="font-family:'courier new', courier, monospace;">document.getElementById("custn").parentNode.parentNode.parentNode.childNodes</span>, and we just implemented in the core viewer code in FramesetFragment.jsp. You can bookmark any of the drill-through elements you want to. You can also prefix them with a specific pattern so you'll be able to target those ones instead by visiting via DOM, or you can target those elements specific to your environment/reports.</p>
<p> </p>
<p>Or you can just target all anchor tags:</p>
<p><span style="font-family:'courier new', courier, monospace;">document.getElementsByTagName('a');</span></p>