on 03-16-2006 4:56 PM
Hi.
Has anyone managed to freeze rows/columns in BW reporting as we can do in xl?That is the first column or Row remains as we scroll through the data.
Cheers
Anand
Looks like this will be standard functionality in BI 7.0 run time as part of SPS 13.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chuck,
Thanks a lot for you help! Your source code works fine!!!
I'm sorry about the impossibilty to give you rewards points for the answer!
I'd like to see a sample for the columns Freezing, could you help me again?
Thanks in advance,
Best Regards,
Domenico
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gurus,
could someone put a working example of the code, please? I'm not able to make it working!
Thanks in advance & Best Regards!
Message was edited by:
DEL SORBO DOMENICO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have been working on this same issue and was glad to find this thread with the sample code. I was able to get it working to some extent though I still have some work to do because I want both the row heading and column heading to be frozen, and I also have more than one heading. The only issue that I had to get this working were there where two places where an array used <> instead of [], which I believe was in the find_sap_table function. Below is the HTML source which I am using and incorporates the code previously provided in this thread.
<HTML>
<!-- BW data source object tags -->
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_DATA_PROVIDER"/>
<param name="NAME" value="DATAPROVIDER_1"/>
<param name="QUERY" value="Z_BOARD_REPORT_WEB"/>
<param name="INFOCUBE" value="ZBCO_M01"/>
DATA_PROVIDER: DATAPROVIDER_1
</object>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_PROPERTIES"/>
<param name="TEMPLATE_ID" value="BOARD01"/>
TEMPLATE PROPERTIES
</object>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
<TITLE>BW Web Application</TITLE>
<link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript">
/******** Find a specific HTML table according to the name attribute *****/
function find_sap_table(table_name) {
var i;
var table;
// get the original table
table=document.getElementsByTagName("table");
for (i=0; i<table.length; i++) {
if (table<i>.getAttribute("name")==table_name)
return table<i>;
}
}
/******** Freeze Header lines *****/
function freeze_header(table_name) {
var obj;
var row;
var x;
var j;
var i;
var td;
// get the original table
obj = find_sap_table(table_name);
row = obj.rows.item(0);
myTHead = obj.createTHead();
myRow = myTHead.insertRow();
// create Thead and TH from the first TR line
//for[ j = 0; j <=3; j++]{
x = obj.rows(1).cells.length;
for( td = 0; td < x; td++ ) {
myCell = document.createElement("TH");
myCell.innerHTML = row.cells(td).innerHTML;
myCell.className = row.cells(td).getAttribute("className");
myRow.appendChild(myCell);
}
// Delete the original header information
obj.deleteRow(1);
}
</script>
<style type="text/css"> div#tbl-container thead th </style>
</HEAD>
<BODY onload="freeze_header('TABLE_1');">
<P><object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="HIERCONTEXTMENU_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_FILTER_HIERDD"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="IOBJNM" value="0PROFIT_CTR"/>
<param name="HIERARCHY_NAME" value="STARBRDEXASP2"/>
<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
ITEM: HIERCONTEXTMENU_1
</object> <object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="NAVIGATIONBLOCK_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_NAV_BLOCK"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
ITEM: NAVIGATIONBLOCK_1
</object>
<div id="tbl-container">
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TABLE_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
<param name="MODIFY_CLASS" value="ZMBOARD"/>
ITEM: TABLE_1
</object></div>
<P></P>
</BODY>
</HTML>
Hope this helps,
Chuck Hall
BI Solution Consultant
Hi Klaus,
Thanks for giving that valuable information on how to use freeze panes in Web reporting. We too have similar requirement to use freeze panes in web reporting.
But we get some problem i.e. how to go to sytle sheets folder.
in our code for stylesheet the code is like this.
<TITLE>BW Web Application</TITLE>
<link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>.
Could you plz tell us how to navigate to go into this. We are not able to judge how to go forward at this point.
Please suggest.
Thanks in advance.
regards,
naveen
naveenkothur@gmail.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tobias: try using table[ i] (but delete the space in the bracket) I had the same problem
I just found out, that in BW version 3.5 there is a possibility to freeze panes without any manual coding. Just use parameters of table web item "Number of Data Rows Displayed at once" (tech.name BLOCK_SIZE) and "Number of Data Columns Displayed at once" (tech. name BLOCK_SIZE_COLUMNS). Enter number of displayed rows and columns and then turn on the parameter "Table scroll area" (above or below). No javascript or special css needed.
Hello Thanks for ur input.
Does it will freeze my healder line of row. I want to see all the columns and rows but want to freeze header line. so when user scroll the report , he /she shld be able to see header line every time. Does it possible with out coding .because when i do number of data columns and rows, it is restricting the report with rows and columns. E.g If i select 10 columns and 50 rows , it showing only the same.. where as i m looking for freezing header line of report.
Please let me know how to do this , as it is urgetn requierment for me. how to activate this function , and is it possible with coding ..as i m not much familier with HTML code ..
Thanks in advance
Regards
Dear Kobus Vorster ,
I would like to use your solution.Can you Please send me the active link/ zip file.
My email address is: g7kiran@gmail.com
Thanks,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to make sense of all the conversation on this topic, but alas I am totally lost. I am not more of a functional consultant (do not know where to include all the HTML and JAVA that are proposed). I need to be able to give users this freeze panes functionality urgently. If anyone can offer me the idiots guide to do this Id be delighted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We had numerous discussions (some quite technical) and attempts to get "freeze frames" to work. In the end it was found to be a quite simple solution and this is what has worked for us (a solution without programming, but that use standard functionality). We use manual planning layouts on the bew inteface buider (transaction BPS_WB).
The following must be done when the manual layout is created in BPS0:
- click on the ME Excel settings button and select the publish for web option
- Put your cursor on the cell where you want to freeze the panes and select Windows -> Freeze panes (as you would do in Excel) this works now the same as in Excel and fix doth column and rows.
The Workbench (transactions=bps_wb) is a tool that is used to create Web interfaces for SAP SEM-BPS. In other word you use this transaction to design the web-interface that the users will access the system. You can use your manual planning layouts and queries when you design this web-interface.
Unfortunately I cannot tell you here how to use this as it is a small course on itself. Perhaps you can have a look in the SAP help to see if you can learn how to use this functionality.
Hi Klaus,
I tried with your code. still not working, its giving message like table "TABLE_1" not known.
please suggest me.
Thanks
Sathya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sathya,
"TABLE_1" has to be replaced with the Item-Id of your table.
Please hava a look at the HTML view of your Web Template.
You will find something similar to this one:
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TABLE_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="WIDTH" value="900"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="BORDER_STYLE" value="NO_BORDER"/>
<param name="ONLY_HIERARCHY_NAVIGATION" value="X"/>
<param name="BLOCK_SIZE" value="0"/>
ITEM: <b>TABLE_1</b>
</object>
In the Javascript function use the name of your Table ID.
Cheers,
Klaus
Hi Klaus,
Thanks for the answer, but I tried with this code.
not working for me. I guess code for function "find_sap_table(table_name);" is not included here. can you please send me the code for this function.
Thanks in advance.
Sathya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Sorry for that mistake: Indeed the JavaScript function "find_sap_table" was missing.
Please find below the code for this function:
/******** Find a specific HTML table according to the name attribute *****/
function find_sap_table(table_name) {
var i;
var table;
// get the original table
table=document.getElementsByTagName("table");
for (i=0; i<table.length; i++) {
if (table<i>.getAttribute("name")==table_name)
return table<i>;
}
}
Unfortunately the HTML table from SAP doesn not have an unique ID. Therefore we need this function to locate the table.
Cheers,
Klaus
Hi,
we're using the technique given here:<a href="http://web.tampabay.rr.com/bmerkey/examples/nonscroll-table-header.html">Table scroll lock</a>
Kind Regards,
Alican
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you use workbook you can use freeze panels options to freeze rows/colums.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
With the help of some JavaScript code this is possible.
Thanks to Brett Merkey's page <a href="http://web.tampabay.rr.com/bmerkey/examples/locked-column-csv.html">Freeze Column Headers</a> I was able to adopt his solution for Webtemplates.
Unfortunately it's not possible to use the Table Interface as you have to create some <thead> and <th> tags inside the <table> tag. The Table Interface only allows you to change the content of <td> tags.
The solution consists of 2 parts.
1. JavaScript Code which changes the <td> tags of the column headers into <th> tags
2. A Stylesheet for the <th> tag which does the column freeze
This is the JavaScript code:
<script type="text/javascript">
/******** Freeze Header lines *****/
function freeze_header(table_name) {
var obj;
var row;
var x;
var i;
var td;
// get the original table
obj = find_sap_table(table_name);
row = obj.rows.item(0);
myTHead = obj.createTHead();
myRow = myTHead.insertRow();
// create Thead and TH from the first TR line
x = obj.rows(1).cells.length;
for( td = 0; td < x; td++ ) {
myCell = document.createElement("TH");
myCell.innerHTML = row.cells(td).innerHTML;
myCell.className = row.cells(td).getAttribute("className");
myRow.appendChild(myCell);
}
// Delete the original header information
obj.deleteRow(1);
}
</script>
This is the StyleSheet:
<style type="text/css">
div#tbl-container {
width: expression(screen.width - (screen.width*3/100));
height: expression(screen.height - (screen.height*39/100));
overflow: auto;
}
thead th {
position:relative;
cursor: default;
top: expression(document.getElementById("tbl-container").scrollTop-2); /* IE5+ only */
}
</style>
In order to make it work the table item has to be embedded within a <DIV> tag like this:
<div id="tbl-container">
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="TABLE_1"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="ONLY_HIERARCHY_NAVIGATION" value="X"/>
<param name="BLOCK_SIZE" value="0"/>
ITEM: TABLE_1
</object>
</div>
The last step is to call the JavaScript function when the page is loaded.
<BODY onload="freeze_header('TABLE_1');">
If your table item is named other than TABLE_1 just change it to your needs.
Hope this helps,
Klaus
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.