בשלב הראשוני ניצור דוח חדש אשר יהיה דוח הלשוניות הראשי. הוסיפו לדוח שני HTML items כאשר הראשון יהיה בכותרת והשני מתחת לכותרת.
לראשון נקרא Tabs ולשני iframe (את השמות ניתן לקבוע ב-properties מצד שמאל למטה של האובייקטים). ה-HTML item השני- iframe, יכיל את הגדרות ה-iframe, נפתח את האובייקט ונעתיק את הקטע הבא:
<iframe src="http://support03-pc:80/ibmcognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Customers%20Reports%27%5d%2ffolder%5b%40name%3d%27LiBi%27%5d%2ffolder%5b%40name%3d%27Tab%27%5d%2freport%5b%40name%3d%27Quantity%27%5d&ui.name=Quantity&run.outputFormat=&run.prompt=true&cv.header=false" frameborder="0" height="800" width="100%"></iframe>
שימו לב שה-src מצביע על הדוח ברירת המחדל של הלשונית הראשונה בדוח הלשוניות.
כמו כן – על מנת שיעבוד לכם אתם צריכים להחליף את הקטע המודגש בנתיב של הדוח שלכם: לכו ל-cognos connection לדוח הרצוי, תלחצו על set properties ותעתיקו את ה- default action URL.
ה-HTML item הראשון מכיל שלושה חלקים עיקריים: פונקציות javascript, CSS style ו-html tags. בתחילה תעתיקו את ה-CSS Style – חלק זה קובע את הצבעים של הלשוניות וכו, ניתן לשנותם:
<"style type="text/css>
#demo-container{padding:25px 15px 0 15px;margin:0 0 15px 0;background:#c3d1e0;}
ul#simple-menu{list-style-type:none;width:100%;position:relative;height:27px;font-family:"Trebuchet MS",Arial,sans-serif;font-size:13px;font-weight:bold;margin:0;padding:11px 0 0 0;}
ul#simple-menu li{display:block;float:left;margin:0 0 0 4px;height:27px;}
ul#simple-menu li.left{margin:0;}
ul#simple-menu li a{display:block;float:left;color:#fff;background:#426695;line-height:27px;text-decoration:none;padding:0 17px 0 18px;height:27px;}
ul#simple-menu li a.right{padding-right:19px;}
ul#simple-menu li a:hover{background:#2E4560;}
ul#simple-menu li a.on{color:#2E4560;background:#fff;}
ul#simple-menu li a.on:hover{color:#2E4560;background:#fff;}
</style>
לאחר מכן תוסיפו את ה-javascript הבא- שימו לב שעליכם להחליף את ה-src עם הדוחות שלכם כפי שעשינו ב-iframe.
<script>
function putContent(n) {
var aLinks = document.getElementsByTagName("a");
for (i=0;i<aLinks.length;i++) {
if(aLinks[i].className == "on") {
aLinks[i].className = "off";
}
document.getElementById("link"+n).className = "on";
}
switch(n) {
case 2: document.getElementById("content").src = "http://support03-pc:80/ibmcognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Customers%20Reports%27%5d%2ffolder%5b%40name%3d%27LiBi%27%5d%2ffolder%5b%40name%3d%27Tab%27%5d%2freport%5b%40name%3d%27Revenue%27%5d&ui.name=Revenue&run.outputFormat=&run.prompt=true&cv.header=false"; break;
case 3: document.getElementById("content").src = "http://support03-pc:80/ibmcognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Customers%20Reports%27%5d%2ffolder%5b%40name%3d%27LiBi%27%5d%2ffolder%5b%40name%3d%27Tab%27%5d%2freport%5b%40name%3d%27Margin%27%5d&ui.name=Margin&run.outputFormat=&run.prompt=true&cv.header=false"; break;
default:document.getElementById("content").src = "http://support03-pc:80/ibmcognos/cgi-bin/cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=%2fcontent%2ffolder%5b%40name%3d%27Customers%20Reports%27%5d%2ffolder%5b%40name%3d%27LiBi%27%5d%2ffolder%5b%40name%3d%27Tab%27%5d%2freport%5b%40name%3d%27Quantity%27%5d&ui.name=Quantity&run.outputFormat=&run.prompt=true&cv.header=false";
}
}
</script>
ובשלב האחרון תעתיקו את ה-HTML elements הבאים: <"div id="demo-container>
<ul id="simple-menu"> <li><a href="nojavascript...putContent(1);void(0);" title=" Quantity" id="link1">Quantity</a></li> <li><a href="nojavascript...putContent(2);void(0);" title=" Revenue" id="link2">Revenue</a></li> <li><a href="nojavascript...putContent(3);void(0);" title=" Margin" id="link3">Margin</a></li> </ul> </div> בדוגמא המצ"ב הדוח יציג שלוש לשוניות: לשונית ראשונה הינה Revenue' השנייה Quantity, והאחרונה Margin.
בהצלחה !
:) |