我是 SSRS
的新手不知道有多少HTML
SSRS 报告中的功能是可行的。我必须学会在 HTML
中建立报告格式化。
有什么方法可以添加ALT
HTML
的功能在 SQL Server 报告服务 (SSRS) 中?
最佳答案
克里斯托弗布朗的回答是错误的。
通过 ToolTip 属性支持 alt 标记。
我使用 alt 标记在 JavaScript 中设置 Logo 的高度,具体取决于图像名称“Logo xy”,因为它可以正确显示在 SSRS 生成的 QuirksMode HTML 中。
如果您需要单独的 Title 和 Alt-Tag 文本,您可以在其中编写 JSON,并在 ReportViewer.aspx 页面上使用 JavaScript 修改属性。
像这样的东西:
var arrimgLogo = document.querySelectorAll("img[onload^='this.fitproportional=true']");
if(arrimgLogo != null && arrimgLogo.length > 0)
{
var img = arrimgLogo[0];
// img.removeAttribute('height');
// img.style.maxWidth = '100%';
// img.style.maxHeight = '100%';
if(img.alt != null && img.alt.toLowerCase() == "Logo SwissRe Left".toLowerCase())
{
img.height = 35;
}
else
{
var tP = img.parentElement;
//console.log(tP);
if(tP != null && tP.tagName == 'DIV' && tP.style != null)
{
tP.style.textAlign = "right";
// if (parseFloat(tP.style.minWidth) != 0) tP.style.width = tP.style.minWidth;
// if (parseFloat(tP.style.minHeight) != 0) tP.style.height = tP.style.minHeight;
} // End if(tP != null && tP.tagName == 'DIV' && tP.style != null)
}
} // End if(arrimgLogo != null && arrimgLogo.length > 0)
关于reporting-services - SSRS 中的 HTML ALT 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23374736/