cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a font in Excel Layout on the Web

Former Member
0 Kudos

Hello, we are currently using an Excel layout on the web and want to change the font for Header info. The documentation says to edit the layout and change the Style of the cell of the appropriate Style Name i.e. SEM-BPS-headdata, SEM-BPS-head, etc. It appears to work when I execute the layout directly in BPS, but when I execute on the Web, the change does not only not show up, but the rendering on the front end PC becomes extremely slow.

Any help would be appreciated.

Scott

Callaway Golf Company

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Scott,

I had sent you detailed response, hope that helps.

Cheers

Srini

Former Member
0 Kudos

Scott,

If you still have issues to resolve this, shoot me an email.I have accomplished this same requirement without any coding and presented the header row in different color, font etc.

Hope this helps.

Cheers

Srini

Former Member
0 Kudos

Hello Scott,

There is one simple way of formatting the font in Excel Layout on the web.

Open your web template using bps_wb. Create a text element right below the layout. It is important that the next object after the layout is this text element.

Write a simple javascript as in example below. In the example below, we used the java script option to manage font sizes. The layout name in CAPS below, should be the technical name of your layout. Please note that the code below needs to be used as is. Insert your code between the lines:

layout_sheet.ActiveSheet.Protection.Enabled = false;

INSERT YOUR CUSTOM CODE HERE ONLY

layout_sheet.ActiveSheet.Protection.Enabled = true;

Hope this helps.

**********************************************************

<script language="JavaScript" type="text/javascript">

<!--

var layout_id = "LAYOUT4";

layout_sheet = document.all( layout_id );

var classIds = ["CLSID:0002E510-0000-0000-C000-000000000046", // 2000

"CLSID:0002E559-0000-0000-C000-000000000046", // 2003

"CLSID:0002E551-0000-0000-C000-000000000046"]; // XP(2002)

// if Excel OWC NOT available => try OCX from another known office version

var defClassId = layout_sheet.classid;

for (i = 0; !layout_sheet.ActiveSheet && i < classIds.length; i++) {

if (classIds<i> == defClassId) continue; // skip default

// remove the irrelevant object

layout_sheet.removeNode();

// create new object & set size attributes

layout_sheet = document.createElement("OBJECT");

layout_sheet.style.height = "0";

layout_sheet.style.width = "0";

// append to dom and activate OCX

var layout_div = document.all( layout_id + "-div" );

layout_sheet = layout_div.appendChild(layout_sheet);

layout_sheet.classid = classIds<i>;

layout_sheet.id = layout_id;

} // loop over OCX classes

if (layout_sheet.ActiveSheet) { // Excel OWC available

// send the office version to the backend

document.all(layout_id + "-class").value = layout_sheet.classid;

layout_sheet.ActiveSheet.Protection.Enabled = false;

range = layout_sheet.Range(layout_sheet.Cells(6 ,1 ),layout_sheet.Cells(6 ,70 ));//

range.Font.Size =8 ; //WE ARE INSERTING CODE HERE

layout_sheet.ActiveSheet.Protection.Enabled = true;

}

// -->

</script>

*********************************************************************************

This approach should help you resolve the problem.

Sunil

Former Member
0 Kudos

Hi,

Why u r not changing u r layout from Excel to ALV grid then it will work in web also.

Thanks,

Debasish

former_member93896
Active Contributor
0 Kudos

Hello Scott,

the standard ranges like headers can not be reformatted (see SAP notes <a href="http://service.sap.com/sap/support/notes/517860">517860</a> and <a href="http://service.sap.com/sap/support/notes/632333">632333</a>).

Send me an email if you want a modification to do it anyway.

Regards,

Marc

SAP NetWeaver RIG

Former Member
0 Kudos

Hi Marc, when I look at the documentation for NW 2004 for BW-BPS. It looks like it clearly starts that you can change some attributes using styles below is the link

http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm

Am I missing something? Thanks again, Scott