直截了当的问题-
如何模拟 SpaceBefore
和 SpaceAfter
在 SSRS 中导入的 HTML 属性?
我们的一份报告经历了相当漫长的过程:
- 从数据库中检索 XML,
- 使用 XSL 转换 XML 以呈现 HTML 输出,
- html 被压缩并存储到一个单独的表中(我们将其用于报告)
- 使用自定义代码在 SSRS 报告中读取并解压缩压缩的 HTML
- 将 HTML 添加到文本框,将输出呈现为 html
SSRS 非常受限于 HTML 可以做什么和不能做什么。我的解决方案要求我需要有一个准确的 spaceBefore
和 spaceAfter
在标题和段落之间,所以输出 <br>
不符合要求和<p style="font-size:6pt"> </p>
在 XSL 中添加根本不起作用( 
实体是一个不间断空间 -
)
我还能尝试在段落和标题前后添加精确间距吗?
这是将 XML 转换为 HTML 的 XSL 片段及其相应的输出(其中的一部分)
<p style="font-size:6pt"> </p>
<!--<xsl:attribute name="style">background-color:<xsl:value-of select="$bgColor"/>;</xsl:attribute>-->
<span>Deine Antwort: </span>
<xsl:call-template name="DisplayAnswer">
<xsl:with-param name="theText" select="answer"/>
</xsl:call-template>
HTML:
<p style="font-size:6pt"> </p>
<span>Deine Antwort: </span>
<ul style="margin-left:15px">
<li>Test</li>
</ul>
最佳答案
这是我用于解决问题的解决方案。
首先,我使用了 <p style="font-size:6pt"> </p>
的方法.我更换了 p-tags
与 div
并添加了 padding-top:<required size in pt>pt
<div style="font-size:1pt;padding-top:5pt;"> </div>
<!--<xsl:attribute name="style">background-color:<xsl:value-of select="$bgColor"/>;</xsl:attribute>-->
<span>Deine Antwort: </span>
<xsl:call-template name="DisplayAnswer">
<xsl:with-param name="theText" select="answer"/>
</xsl:call-template>
这在段落之间创建了我需要的相同数量的“间距”。我还在 header 之间必要时修改了此代码段(我需要 11pt)并且报告使用适当的“spacebefore
”和“spaceafter
”呈现 HTML
关于html - SSRS 中 HTML 的 Spacebefore 和 Spaceafter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30053693/