Monday, January 6, 2014

Cognos: Hide excel/xml/csv output options in cognos viewer using java script

create HTML item in header/footer of the report and copy and paste the following code

<script language="JavaScript">
var y=getFormWarpRequest().elements["cv.id"];

// RS means it has been launched from Report Studio
// _NS_ means it has been launched from Cognos Connection
if(y.value == "RS") {
window.oCVRS.rvMainWnd.setToolbar(
{
"namespace":"RS",
"divId":"CVToolbarRS",
"style":"toolbar","S":[
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"B":
{"N":"runIn",
"ALT":"Change report format",
"M":
{"id":"runInwindow.oCVRS",
"Y":"dropDown",
"IS":[
{"I":
{"N":"viewInHTML",
"A":"window.oCVRS.getRV().viewReport(\'HTML\');",
"E":"View in HTML Format",
"C":"/ibmcognos/rv/images/action_view_html.gif"}
},
{"I":
{"N":"viewInPDF",
"A":"window.oCVRS.getRV().viewReport(\'PDF\');",
"E":"View in PDF Format",
"C":"/ibmcognos/rv/images/action_view_pdf.gif"}
}
]
}
}
},
{"P":
{"Y":"vertical_line"}
},
{"B":
{"N":"openWith",
"M":
{"id":"openWithwindow.oCVRS",
"Y":"dropDown",
"H":"true",
"IS":[]}
}
}
]
}
);
}else{
window.oCV_NS_.rvMainWnd.setToolbar(
{"namespace":"_NS_",
"divId":"CVToolbar_NS_",
"style":"toolbar",
"S":[
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"P":
{"Y":"vertical_line"}
},
{"B":
{"N":"runIn",
"ALT":"Change report format",
"M":
{"id":"runInwindow.oCV_NS_",
"Y":"dropDown",
"IS":[
{"I":
{"N":"viewInHTML",
"A":"window.oCV_NS_.getRV().viewReport(\'HTML\');",
"E":"View in HTML Format",
"C":"/ibmcognos/rv/images/action_view_html.gif"}
},
{"I":
{"N":"viewInPDF",
"A":"window.oCV_NS_.getRV().viewReport(\'PDF\');",
"E":"View in PDF Format",
"C":"/ibmcognos/rv/images/action_view_pdf.gif"}
}
]
}
}
},
{"P":
{"Y":"vertical_line"}
},
{"B":
{"N":"openWith",
"M":
{"id":"openWithwindow.oCV_NS_",
"Y":"dropDown",
"H":"true",
"IS":[]}
}
}
]
}
);
}

</script> 

Monday, November 25, 2013

COGNOS: Add a Multimedia File to a Report

Place your Video ( .wmv or .avi  format)  in the following path

C:\Program Files\ibm\cognos\c10\webcontent\samples\images\

Note: You must have Windows Media Player installed on your computer.


  1. In the Insertable Objects pane, on the Toolbox tab, drag the HTML Item object  to the report.
  2. Select the HTML Item.
  3. double-click the HTML Item 
  4. In the HTML dialog box, type the following:
    <OBJECT classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"> <PARAM NAME="URL" VALUE="/c10/webcontent/samples/images/yourVideo.wmv"/> </OBJECT>

Run the report and click on Video and enjoy...