gpt4 book ai didi

html - 如何在 SSRS 电子邮件报告中包含内联(未链接)图像?

转载 作者:太空狗 更新时间:2023-10-29 15:11:54 25 4
gpt4 key购买 nike

我有多个包含嵌入式图像的 SSRS 2008 报告模板,这些模板目前在任何报告管理器预览中都按预期显示(使用呈现扩展 HTML 4.0)。但是,我需要将这些报告作为 HTML 电子邮件发送出去。

我相信这里最基本/最简单的技术是将图像作为内联 base64 字符串附加到 HTML 中的图像标签。有没有办法在 SSRS 中自动执行此操作,或者实现此或类似结果的最佳实践是什么(即图像作为附件导致不太互操作的 MHTML 而不是纯 HTML)?

电子邮件必须按原样显示,不连接任何外部存储(即发件人无法托管图像)。此外,我们不会使用 SSRS 本身来发送生成的 HTML/电子邮件,因此无需担心此类性质的任何限制。

我想到的内联 base64 示例:

<img src="data:image/png;base64,xxxxxxxx==" alt="Some Image">

最佳答案

看起来实现此目的的最简单方法是按照 MSDN documentation 中的描述稍微修改或扩展渲染扩展。 :

Writing Custom Rendering Extensions

Before you decide to create a custom rendering extension, you should evaluate simpler alternatives. You can:

  1. Create a modified version of an existing rendering extension.
  2. Customize rendered output by specifying device information settings for existing extensions.
  3. Add custom formatting and presentation features by combining XSL Transformations (XSLT) with the output of the XML rendering format.

Writing a custom rendering extension is difficult to do as well as to learn.. A rendering extension must typically support all possible combination of report elements. The report object model is extensive (the classes, interfaces, methods, and properties that you must implement number in the hundreds), and the documentation and samples are not yet at a level that can support you through a challenging development project.

If you must render a report in a format that is not included with Reporting Services, you can write your own managed code implementation of a rendering extension. The rendering extension code must implement the IRenderingExtension interface, which is required by the report server. Each of the rendering extensions implemented by Microsoft and shipped with Reporting Services uses a common set of interfaces. This ensures that each extension implements comparable functionality and reduces the complexity of the rendering code in the core of the report server.

关于html - 如何在 SSRS 电子邮件报告中包含内联(未链接)图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12001060/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com