Hi,
I have a simple custom report that works fine if I go to Edit Source and then “Preview” it. But none of the objects appear at all if I just click through to it from the Reports List page.
Anyone have any ideas? The code is below.
Thanks,
Simon.
<style type="text/css">
a {
text-decoration: none;
}
a:hover {
color: #FF8000;
font-weight: bold;
text-decoration: none;
}
table.sortable {
margin: 0;
border-collapse: collapse;
color: #222;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
th.res {
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
color: navy;
font-weight: bold;
background-color: #F2F2F2;
border: 1px solid #cccccc;
margin: 0;
padding: 4px 10px 4px 5px;
text-align: left;
}
td.res {
color: #222;
font: 8pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
border-bottom: 1px solid #cccccc;
margin: 0;
/* padding: 6px 20px 1px 0; */
padding: 8px 20px 5px 5px;
}
td.userinput {
color: #222;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
font-weight: bold;
border-bottom: 0px;
margin: 0;
padding: 6px 20px 1px 0;
}
td.errormsg {
color: red;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
font-weight: bold;
border-bottom: 0px;
margin: 0;
padding: 6px 20px 1px 0;
}
td.msg {
color: #747170;
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
font-weight: bold;
border-bottom: 0px;
margin: 0;
padding: 6px 20px 1px 0;
}
/*h3 {
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
background-color: #747170;
padding: 4px 4px 4px 4px;
color: white;
width: 100%;
}*/
div.default {
font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
padding: 4px 4px 4px 4px;
color: black;
width: 100%;
}
#CalendarControlIFrame {
display: none;
left: 0px;
position: absolute;
top: 0px;
height: 250px;
width: 250px;
z-index: 99;
}
table.date {
text-align: center;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif ;
font-weight: normal;
font-size: 14px;
color: #fff;
width: 400px;
background-color: #777;
border: 0px;
border-collapse: collapse;
border-spacing: 0px;
}
table.date td.dateleft {
background-color: #CCC;
color: #000;
padding: 4px;
text-align: right;
border: 0px;
}
table.date td.dateright {
background-color: #CCC;
color: #000;
padding: 4px;
text-align: left;
border: 0px;
}
table.stats {
text-align: center;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif ;
font-weight: normal;
font-size: 14px;
color: #fff;
width: 400px;
background-color: #666;
border: 0px;
border-collapse: collapse;
border-spacing: 0px;
}
table.stats td {
background-color: #CCC;
color: #000;
padding: 4px;
text-align: left;
border: 1px #fff solid;
}
table.stats td.result {
background-color: #CCC;
color: #000;
padding: 4px;
text-align: right;
border: 1px #fff solid;
}
table.stats td.hed {
background-color: #666;
color: #fff;
padding: 4px;
text-align: left;
border-bottom: 2px #fff solid;
font-size: 14px;
font-weight: bold;
}
</style>
<script type="text/javascript" src="sortables.js"> </script>
<div id="heading" class="default">
This report provides all outstanding applicable fixlets that are components of the selected baseline. It takes it's relevance from (and returns only computer data from) the relevance of the baseline itself. </br></br>
</div>
<table id="gather" class="stats">
<tr>
<td class="userinput" >
Select Baseline:
</td>
<td class="userinput">
<select id = "baselineName" name = "baselineName" size = "1">
<option value = "default" selected = "true" style = "background-color: #532900; color: white;" > --Select Baseline-- </option>
<?relevance (html "<option value=%22" & it & html "%22>" & it & html "</options>") of unique values of names of bes fixlets whose (baseline flag of it = true)?>
</select>
</td>
<td class="userinput">
<input type='button' onclick='search()' value='Generate Report'/>
</td>
</tr>
</table>
<hr />
<div id="resultsDiv">
</div>
<script type="text/javascript">
addEvent(window, "load", init_load);
var divRes = document.getElementById('resultsDiv');
var computerFilter;
var res_count
function search(){
if (document.getElementById('baselineName').value == 'default') {
divRes.style.display = 'block';
divRes.innerHTML = 'Please select a baseline.';
return;
}
divRes.style.display = 'block';
divRes.innerHTML = 'Processing...';
var relevance = '(html "<table id=%22resultsTable%22 class=%22sortable%22><tr class=%22res%22><th class=%22res%22>Computer Name</th><th class=%22res%22>Fixlet Name</th></tr>" & it & html "</table>") of concatenations of trs of (td of (item 0 of it) & td of (item 1 of it)) of ((names of it) of elements of applicable computer set of it as string, names of it as string) of components of component groups of bes fixlets whose ( baseline flag of it = true and name of it = "' + baselineName.value + '")';
strResponse = EvaluateRelevance(relevance);
divRes.innerHTML = strResponse;
// sortables_init();
stripe('resultsTable', '#fff', '#E6E3E8');
}
function init_load() {
// stripe('resultsTable', '#fff', '#E6E3E8');
// sortables_init();
var divHeading = document.getElementById('heading');
var tableGather = document.getElementById('gather');
divHeading.style.display = 'block';
tableGather.style.display = 'block';
}
function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
result = obj.getAttributeNode("class").value;
}
return result;
}
function stripe(id) {
// the flag we'll use to keep track of
// whether the current row is odd or even
var even = false;
// if arguments are provided to specify the colours
// of the even & odd rows, then use the them;
// otherwise use the following defaults:
var evenColor = arguments[1] ? arguments[1] : "#fff";
var oddColor = arguments[2] ? arguments[2] : "#eee";
// obtain a reference to the desired table
// if no such table exists, abort
var table = document.getElementById(id);
if (! table) {
return;
}
// by definition, tables can have more than one tbody
// element, so we'll have to get the list of child
// <tbody>s
var tbodies = table.getElementsByTagName("tbody");
// and iterate through them...
for (var h = 0; h < tbodies.length; h++) {
// find all the <tr> elements...
var trs = tbodies[h].getElementsByTagName("tr");
// ... and iterate through them
for (var i = 0; i < trs.length; i++) {
// get all the cells in this row...
var tds = trs[i].getElementsByTagName("td");
// and iterate through them...
for (var j = 0; j < tds.length; j++) {
var mytd = tds[j];
mytd.style.backgroundColor =
even ? evenColor : oddColor;
}
// flip from odd to even, or vice-versa
even = ! even;
}
}
}
</script>