Hi,
I am trying to create a header section at the top of a Web Template, that comprises the following:
A table with one row and three cells
In the first (left-side) cell, our company logo
In the second (middle-cell) - the report name with last month shown (e.g. Profit & Loss - December 2006). The last month will be derived using embedded javascript.
In the third (right-side) cell - a print button
All looks okay - except the Java-script that derives month is appearing outside and before the table.
i.e instead of looking like this:
[Logo] | Profit & Loss - December 2006 | [Print]
it is appearing like this:
December 2006
[Logo] | Profit & Loss - | [Print]
I have placed this table in a container item and "December 2006" still appears outside of the table (and seemingly outside of the container).
The code is like so:
<bi:CONTAINER_ITEM name="CONTAINER_ITEM_1" designwidth="600" designheight="600" > <bi:FULL_WIDTH value="X" /> <table cellspacing="0" cellpadding="0" width="100%" bgcolor="#dfddd6" border="0" > <tbody > <tr > <td > <img height="60" alt="Logo" src="bwmimerep:///sap/bw/mime/Customer/Images/top_logo.gif" width="270" border="0" /> </td> <td width="450" > <b > Profit & Loss Statement - <bi:SCRIPT_ITEM name="SCRIPT_ITEM_1" designheight="300" designwidth="600" > <bi:SCRIPT value="biLargeData:GSZMYGU8U9DFN5LA6Q3BNCD5Z" /> </bi:SCRIPT_ITEM> </b> </td> <td width="150" > <div align="right" > <bi:BUTTON_GROUP_ITEM name="BUTTON_GROUP_ITEM_1" designheight="70" designwidth="300" > <bi:BUTTON_LIST type="ORDEREDLIST" > <bi:BUTTON type="COMPOSITE" index="1" > <bi:CAPTION value="Print" /> <bi:ACTION type="CHOICE" value="INSTRUCTION" > <bi:INSTRUCTION > <bi:EXPORT > <bi:HEADER_LEFT value="DATETIME" /> <bi:FOOTER_RIGHT value="PAGEOFPAGES" /> <bi:ITEM_REF_LIST type="UNORDEREDLIST" > <bi:ITEM_REF index="1" value="ANALYSIS_ITEM_1" /> <bi:ITEM_REF index="2" value="ANALYSIS_ITEM_2" /> </bi:ITEM_REF_LIST> </bi:EXPORT> </bi:INSTRUCTION> </bi:ACTION> <bi:BUTTON_DESIGN value="EMPHASIZED" /> </bi:BUTTON> </bi:BUTTON_LIST> </bi:BUTTON_GROUP_ITEM> </div> </td> </tr> </tbody> </table> </bi:CONTAINER_ITEM>
and the javacript (which should appear in the middle cell) is like this:
<!-- now = new Date(); year_str = now.getYear(); switch (now.getMonth()-1){ case -1: month_str = "December"; year_str = year_str-1; break; case 0: month_str = "January"; break; case 1: month_str = "February"; break; case 2: month_str = "March"; break; case 3: month_str = "April"; break; case 4: month_str = "May"; break; case 5: month_str = "June"; break; case 6: month_str = "July"; break; case 7: month_str = "August"; break; case 8: month_str = "September"; break; case 9: month_str = "October"; break; case 10: month_str = "November"; break; } document.write(month_str + ' ' + year_str); //-->
Many thanks for any assistance.
Regards
Adrian