cancel
Showing results for 
Search instead for 
Did you mean: 

Freeze Panes in web reports

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (10)

Answers (10)

Former Member
0 Kudos

Looks like this will be standard functionality in BI 7.0 run time as part of SPS 13.

Former Member
0 Kudos

I have SPS13, but i can't search this standard functionality.

Can you help me?

Thanks.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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>&nbsp;<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

Former Member
0 Kudos

this one works now

great !

now i'm doing some finetuning in layout.

if you put the stylesheet code between

@media screen {} 

the scrolling effect is only on screen, but when you are printing, you get the whole list instead of just a small part.

Former Member
0 Kudos

I tried the code provided above but it somehow is not working. If you could send me a working sample code it would be a great help. Thanks so much.

Shantikr

shantikr@gmail.com

Former Member
0 Kudos

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

Former Member
0 Kudos

naveen, you don't have to go to the style sheet folder. just copy and paste the provided code into your template between the tags "<head>" "</head>" and you are done.

Former Member
0 Kudos

Hi,

just tried this code in our development system.

Got errors in the line with the following javscript code.

		  if (table<i>.getAttribute("name")==table_name)

Internet Explorer and Firefox say: syntax error.

Kind regards,

Tobias

Former Member
0 Kudos

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.

Former Member
0 Kudos

thx .. .i will try.

The problem with the standard function is, that you can only print what you see in browser. Our customers want to print the whole table, but if they watch the table the want a fixed header.

Former Member
0 Kudos

to print the whole table at once you can export it to Excel and than print it. But it is just a workaround...

Former Member
0 Kudos

this also won't work if you have used the table interface.

Former Member
0 Kudos

I am using standard table interface so, export to excel works for me. Anyway, try the code from Klaus, it should solve your problem I guess.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

as I mentioned before you have to turn on the parameter "Table scroll area". Then you will see navigational buttons for scrolling left-right and up-down. You will see header line every time.

Hope it helps...

Former Member
0 Kudos

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

Former Member
0 Kudos

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 I’d be delighted.

michael_koch9
Active Participant
0 Kudos

Hallo,

send me a basic web template code and i will send you one back with this freeze function.

i plan to write a blog on that because i see this question many times, but that will take at least one week till i finsihed it, sorry.

SO i wait for your code.

Regards

Marcus

Former Member
0 Kudos

Marcus,

How do I "extract" / download the code for you and what is your e-mail address (so that I can send this to you).

Thanks, Kobus

michael_koch9
Active Participant
0 Kudos

Hi,

1) go to WAD

2) open your template

3) at the bottom of the template there are options like "Layout" and "HTML". Chooce HTML

4) Select all ypur Code (STRG+A)

5) Copy the code (STRG+V)

Insert code into your email programm, my email adress is marcus-p@web.de

Regards

Marcus

Former Member
0 Kudos

Hi Marcus,

Can you please send me the code. I am little confused where to write these codes. We also need this option of freezing panes.

Appreciate if you send code as well as steps how to go about it.

Thanks

Ramesh Ganji

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Kobus Vorster,

Thanks for the answer. can you be more clear on this? I don't know any thing about web interface builder. Please give me the detailed steps.

Thanks

Sathya

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Marcus and Klaus,

I am looking for a solution to freeze the header columns. I tried with the above

java script code but did not work. please suggest me.

points will be awarded.

Thanks & Regards,

Kumar.

Former Member
0 Kudos

Hi Klaus,

I tried with your code. still not working, its giving message like table "TABLE_1" not known.

please suggest me.

Thanks

Sathya

S0007726612
Explorer
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sathya,

Did you ever get this to work. I need to do the same and I was wondering if code for find_sap_table(table_name) was defined? If so could you post it?

Thanks in advance

Ravi

Former Member
0 Kudos

Hi Ravi,

we don't know what code has written in find_sap_table(table_name) function, atleast if we have any clue about this function, we can try, if anyone has any clue plz...

Sathya

S0007726612
Explorer
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

if you use workbook you can use freeze panels options to freeze rows/colums.

Former Member
0 Kudos

Thanks PVR. I know that you could do it in the workbook. But how do you do it on the browser?

Anand

former_member184494
Active Contributor
0 Kudos

An option would be to use static HTML headers and not show the headings in the reports... it would appear as frozen columns.

Anothe roption is to make better use of the pagination function instead of freezing columns.

Arun

Former Member
0 Kudos

Thanks Arun. But could you please elaborate on the methods?

Anand

S0007726612
Explorer
0 Kudos

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