Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SMARTFORMS HTML - Inline CSS

Former Member
0 Likes
985

Hello!

   There is a known issue with opening HTML SmartForm with CSS <HEAD><STYLE> block definition in the e-Mail clients, like Outlook.

   The solution to the problem is to use inline CSS definition in HTML.

   SAP gives a SmartForm generation option to set XSF parameter FORMAT-LOCATION to the following values:

  • 'STANDALONE',
  • 'EMBEDDED' (default),
  • 'LINKED',
  • 'INLINE',

    I have set the parameter to INLINE; however it doesn't work.

    The only change are empty style="" attributes in HTML tags.

    Does anyone know if there is any way to make it working?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Here is the solution...

There is an error in SAP, particulary in SF_XSLT transformation. (Package SMART)

<xsl:when test="($p_fmt_location = $cxsf_css_loc_inline)">

      <xsl:attribute name='style'><xsl:value-of select='@xhtml:style' /></xsl:attribute>

In the formula above there the style definition is referenced by the namespace xhtml: select='@xhtml:style' .

The problem is that there is no such namespace declaration in the header.

By adding the two lines:


<xsl:stylesheet version="1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform
"
xmlns:xml=
"http://www.w3.org/TR/REC-xml"
xmlns:xsf=
"urn:sap-com:SmartForms:2000:xsf"
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:xfa=
"http://www.xfa.org/schema/xfa-template/2.1/"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
exclude-result-prefixes=
"xsf"
exclude-result-prefixes="xhtml"
>

…the problem is solved.

2 REPLIES 2
Read only

Lakshmipathi
SAP Champion
SAP Champion
0 Likes
732

Moved from SAP ERP Sales and Distribution (SAP SD) to ABAP Development

Read only

Former Member
0 Likes
733

Here is the solution...

There is an error in SAP, particulary in SF_XSLT transformation. (Package SMART)

<xsl:when test="($p_fmt_location = $cxsf_css_loc_inline)">

      <xsl:attribute name='style'><xsl:value-of select='@xhtml:style' /></xsl:attribute>

In the formula above there the style definition is referenced by the namespace xhtml: select='@xhtml:style' .

The problem is that there is no such namespace declaration in the header.

By adding the two lines:


<xsl:stylesheet version="1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform
"
xmlns:xml=
"http://www.w3.org/TR/REC-xml"
xmlns:xsf=
"urn:sap-com:SmartForms:2000:xsf"
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:xfa=
"http://www.xfa.org/schema/xfa-template/2.1/"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
exclude-result-prefixes=
"xsf"
exclude-result-prefixes="xhtml"
>

…the problem is solved.