Drag and drop it to your browser's bookmark bar. On a direct SQL report's edit page, click it. It will do the following cleaning tasks to all column headings:
- Remove all double quotes.
- Replace all underscores with spaces.
- Uppercase first letters and lowercase remaining letters of all words, except for all CAPITAL words.
Browser compatibility: Google Chrome (yes), FireFox (yes), Opera (yes), IE (no).
Here is the JavaScript code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
window.showObieeMsg = window.showObieeMsg || function(msg){ | |
var msgDiv = document.querySelector('td#idStatusIndicator div'); | |
if(!msgDiv){ | |
msgDiv = document.querySelector('td#idStatusIndicator'); | |
msgDiv.innerHTML = '<div class=\'StatusIndicatorDiv\'></div>'; | |
msgDiv = document.querySelector('td#idStatusIndicator div'); | |
} | |
msgDiv.innerHTML = msg; | |
setTimeout(function(){msgDiv.innerHTML=''}, 5000); | |
}; | |
document.querySelectorAll('td.SelectCellC').forEach(function(c){ | |
var caption = c.tColNode.selectSingleNode('.//saw:text'); | |
if(caption && caption.innerHTML){ | |
var t = caption.innerHTML.replace(/"/g, '').split(/ |_/); | |
t.forEach(function(w, i){ | |
if(!w.match(/^[A-Z]+$/)) | |
t[i] = w[0].toUpperCase() + w.substring(1).toLowerCase(); | |
}); | |
caption.innerHTML = t.join(' '); | |
} | |
}); | |
XUIPanel.getEditor('idReport').displayHTMLColumns(); | |
showObieeMsg('All columns renamed'); | |
})(); |
No comments:
Post a Comment