【问题标题】:Create a report from word or pdf documents从 word 或 pdf 文档创建报告
【发布时间】:2011-07-24 03:22:49
【问题描述】:

我的目标是使用 dev express 在 WPF 中创建报告。我想将 word 或 pdf 文档添加到报告中。

对于word文档,我将word文档打开到RichEditControl中,将其作为rtf文档保存到内存流中,并使用XRrichText控件,我将rtf文档添加到报表中。

public void CreateReport()
{
    RichEditControl richEdit = new RichEditControl();
    MemoryStream stream = new MemoryStream();
    XRRichText rtfDoc = new XRRichText();

    richEdit.LoadDocument(@"word document path", DocumentFormat.OpenXml);
    richEdit.SaveDocument(stream, DevExpress.XtraRichEdit.DocumentFormat.Rtf);

    rtfDoc.LoadFile(stream, XRRichTextStreamType.RtfText);
    rtfDoc.WidthF = 550F;

    this.Detail.Controls.Add(rtfDoc);
    this.RequestParameters = false;
    this.CreateDocument();
}

这是将 word 文档添加为 rtf 的推荐方法吗? 还有,我怎样才能将 pdf 文档添加到报告中,而不是 word 文档?

谢谢!

【问题讨论】:

    标签: c# wpf devexpress report


    【解决方案1】:

    查看XtraRichEdit - Document Server (available now in v2011, volume 1) 博客文章,这可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 2012-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多