If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

List report not working good while run the report using URL?

Started by vignesvar, 17 Jul 2015 04:18:30 AM

Previous topic - Next topic

vignesvar

Hi all,
  I was create a list report in report studio 10.2. This is an expand and collapse report done by Java script using relational package. Problem is report run correctly in cognos connection, When I run the same report using that report URL it display only the header of the list then chart are working correctly but list report data is not display. Running using cognos connection both list data and chart working fine. Please help me to solve this issue.

Thank you in advance.

MFGF

Quote from: vignesvar on 17 Jul 2015 04:18:30 AM
Hi all,
  I was create a list report in report studio 10.2. This is an expand and collapse report done by Java script using relational package. Problem is report run correctly in cognos connection, When I run the same report using that report URL it display only the header of the list then chart are working correctly but list report data is not display. Running using cognos connection both list data and chart working fine. Please help me to solve this issue.

Thank you in advance.

How can anyone offer help when you haven't given any detail about how you have implemented your expand and collapse? "By Java script" could mean anything, couldn't it? You are essentially saying

"I have written a report, added some of my own custom code, I am not divulging what that code is or how it works, but I want someone to tell me what is wrong."

MF.
Meep!

vignesvar

Hi MF,
Thank you for your response. I don't know how to explained my list report in forum! Even codes are working good while run the report in cognos connection. Using HTML tags in List header, Body and List footer. Here I Attached my report.

MFGF

Quote from: vignesvar on 17 Jul 2015 06:14:58 AM
I don't know how to explained my list report in forum! Even codes are working good while run the report in cognos connection. Using HTML tags in List header, Body and List footer.

Hi,

I'm struggling to understand how you're not able to explain code you wrote in your report? If you can't explain it, how did you write it in the first place?

As you're probably aware, I don't use javascript and I don't "do" javascript, so I'm not able to debug the code you wrote. However, it seems to me the issue must be in the initial HTML item, which contains:

<span id="ExpandedTable"> </span>
<script>

var displayStyle = "";
var noDisplayStyle = "none";

var currentRow = 0;

// This function expands/collapses a table where the first columns have +/- icons
function ExpandCollapse(el,loc) {
        // change icon
       el.src = "../pat/images/expand_" + (isPlus(el) ? "minus" : "plus") + ".gif";
       var tr = el.parentNode.parentNode; // the current row

       currentRow = tr.rowIndex;
       showLines(el);
}

function showLines(el) {
       var show = true;  // to show lines or not

       // Grab the ROW that was clicked and the TABLE that contains it
       var tr = el.parentNode.parentNode; // the current row
       var tbl = tr.parentNode.parentNode; // the table
       var cid = el.parentNode.cellIndex; // the index of the column

       if (isPlus(el)) {
              show = false;
       } else {
              show = true;
       }

       while (currentRow < tbl.rows.length-1) {
              currentRow++;
              var trCurrent = tbl.rows[currentRow];
              var index = findIconInRow(trCurrent, 0); // return the index of the first img
              if (index >= 0 && index <= cid) {
       trCurrent.style.display = displayStyle;
currentRow--;
return; // found the next line with icon in the same column; return
              }

              if (!show) {
trCurrent.style.display = noDisplayStyle;
              } else {
trCurrent.style.display = displayStyle;
var iconIndex = findIconInRow(trCurrent, cid + 1);
if (Number(iconIndex) > -1) {
       var icon = trCurrent.cells[iconIndex].firstChild;
       showLines(icon);
}
              }
       }
}

function isPlus(el) {
return el.src.indexOf("minus") == -1;
}

function hasIcon(cell) {
// return true if this cell has an img
if ((Number(cell.childNodes.length)) == 0) {
return false;
}
var c = cell.firstChild;
if (c != null) {
return (c.tagName == "IMG");
}
return false;
}

function findIconInRow(trCurrent, cid) {
for ( var i = cid; i < trCurrent.cells.length; i++) {
if (hasIcon(trCurrent.cells[i])) {
return i;
}
}
return -1;
}

function StartHidden() {
       var q=document.getElementById("ExpandedTable");

       // get the table
       tbl = q.parentNode.parentNode.parentNode.parentNode;
       var isFirstRow=true;

       for ( var i = 0; i < tbl.rows.length; i++) {
              var trCurrent = tbl.rows[i]; // the current row
              var d = trCurrent.cells[0]; // first cell
              var c = d.firstChild;

              if (i < 2 || c.tagName.indexOf("IMG") != -1) {
                     c = c.src; // leave it visible, since it has + icon
for ( var j = 1; j < trCurrent.cells.length; j++) {
       trCurrent.cells[j].width="1";
}
              }
              else {
                     trCurrent.style.display = "none"; // hide the row
              }
       }
}

</script>


Can you explain the logic in this code so we can perhaps narrow down where you went wrong?

MF.
Meep!

bdbits

So are you saying the report with javascript runs fine in Cognos Connection and the expand/collapse works, but when you use an action URL it does not? A cursory glance through your report looks like things are generally set up ok, though I did not verify the logic.

If the javascript is working in Cognos Connection then the script itself is likely not a problem. Does the script show in the page source when run as an action URL? Is the report being executed with the same credentials as when it is running in Cognos Connection? There is a permission setting for HTML Items in admin, security, capabilites, under Report Studio. Without it I do not think the script will be rendered into the page source, so I would check that first.

vignesvar

Hi bdbits,
Thank you very much for your response, Recently checked my expand/collapse report. It is working only in report studio. I wrongly thought it was run in cognos connection so I heard apology for my activities. Then that report is not working in cognos connection and URL. When I run the report through cognos connection I won't get the table data except list table header then chart is working correctly same as happened when run the report using URL. Please let me to solve this issue.

Thank you very much,