报告。 MS Word 模板所需人口

发布于 2024-09-02 09:40:25 字数 562 浏览 2 评论 0原文

我们开发的应用程序使用数据库中的数据填充 MS Word 模板。客户需要能够通过 MS Word 编辑 Word 模板(更改样式、字体、布局等),无需安装其他软件,也无需培训。

AFAIK、Sql Reporting Services 和 Crystal Reports 无法填充 MS Word 中生成的 MS Word 模板。因此,我们实现了自定义解决方案,将 .net 类映射到 xml 保存的 MS Word 文档。看起来我们声明

class MyTemplate
{
   // maps to [age] field declared in ms document straight in the text 
   int Age { get; set; }

   // maps to table by attributes applied to property (omitted)
   List<Person> Persons { get; set; }
}

我们还实现了图像插入。

是否有任何免费的库可以完成此任务,或者您可以在项目中使用自己的 MS-word 模板器吗?

Application we developed fills MS Word templates with data from Database. Customers require to have ability edit Word templates via MS Word (change style, font, layout e.t.c) with no additional software to be installed and no training.

AFAIK, Sql Reporting Services and Crystal Reports can't populate MS Word templates produced in MS Word. So we implemented our custom solution that maps .net classes onto xml-saved MS Word documents. It looks like we declare

class MyTemplate
{
   // maps to [age] field declared in ms document straight in the text 
   int Age { get; set; }

   // maps to table by attributes applied to property (omitted)
   List<Person> Persons { get; set; }
}

We also implemented images insertion.

Are there any free libraries for this task or may be you use your own MS-word templators in your projects?

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

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

发布评论

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

评论(2

夜夜流光相皎洁 2024-09-09 09:40:25

我一直使用 MS Word 的邮件合并功能来处理此类事情:Word 可以连接到大量数据源(Excel、CSV、SQL Server、ODBC 等),因此通常可以将所需的数据转换为某种格式它可以接受。然后,创建邮件合并文档并使用下拉列表在需要的地方插入数据库字段就相当容易了。

I've always used MS Word's Mail Merge features for this sort of thing: Word can connect to a large number of data sources (Excel, CSV, SQL Server, ODBC etc), so it's usually possible to get the data required into a format that it can accept. Then it's fairly easy to create a mail merge document, and insert the database fields where required using a drop-down list.

巷子口的你 2024-09-09 09:40:25

我认为对于你正在做的事情(我可能没有正确理解你的问题)你应该能够使用 OpenXML。您可以将其全部读入,填充节点,然后写回。

I think for what you are doing (I may not be understanding your question correctly) you should be able to use OpenXML. You can read it all in, populate the nodes, and write it back out.

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