使用 C# 在 RDLC 报告中插入 Word 文档内容(带格式)

发布于 2024-09-19 03:13:44 字数 313 浏览 3 评论 0原文

我正在用 C# 创建一个 RDLC 报告。在导出为 PDFWord 2003 文档 的内容(带格式)(无论是在设计时还是以编程方式) >。最终结果将是一个 PDF 文件,其中包含初始报告(数据库中的字段)及其后面的 Word 文档 内容。

为什么会这样?我需要让用户能够填写表单、附加 Word 文档并将所有内容导出为 PDF,如我之前所述 (ASP.NET)。我的服务器上没有安装 Word,因此无法与其 COM 对象交互。

谢谢。

I'm creating a RDLC report in C#. Is it possible to insert the content of a Word 2003 document (with formatting) in it (either in design time or programmatically) before exporting to PDF. The final result will be a PDF file containing the initial report (fields from database) and the Word document content following it.

Why this? I need to give the user the possibility to fill a form, attach a word document and export the all to PDF as I described earlier (ASP.NET). I don't have Word installed on the server so I can't Interact with its COM objects.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰雪之触 2024-09-26 03:13:44

word文档使用什么格式?如果是 .docx,您可以尝试使用 来自 Microsoft 的开放式 XML SDK

不确定如何导入格式。

Which format does the word document use? If it's .docx, you can try going with the Open XML SDK from Microsoft.

Not sure about how to import the formatting.

蓝戈者 2024-09-26 03:13:44

这个问题很久以前就被问到了,所以我怀疑这个答案对OP会有多大用处,但是如果其他人像我一样偶然发现这个问题......

我认为使用第三个应该相当容易party 组件将文档转换为图像,然后在 RDLC 中使用它,没有太多麻烦。

This question was asked a long time ago, so I doubt this answer will be of much use to the OP, but if someone else stumbles across this as I did...

...I would think it should be fairly easy using a 3rd party component to convert the doc to an image and then use that in the RDLC without much hassle at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文