The MindFusion Forums
MindFusion.Reporting >> WPF >> DocumentViewer's search function does not work
https://mindfusion.eu/Forum/YaBB.pl?num=1367548896

Message started by luolishuang on May 3rd, 2013 at 2:41am

Title: DocumentViewer's search function does not work
Post by luolishuang on May 3rd, 2013 at 2:41am
The lower left corner of the search function in DocumentViewer can not be used,Can this be solved??

Title: Re: DocumentViewer's search function does not work
Post by Meppy on May 3rd, 2013 at 6:01am
Hi,

The WPF DocumentViewer's search function do not appear to work with FixedDocument documents. You can convert the FixedDocument created by MindFusion.Reporting to an XPS document and show this XPS document in the viewer. The following method can help you convert FixedDocument objects to XPS:

[code]private IDocumentPaginatorSource FixedToXps(FixedDocument doc)
{
     var stream = new MemoryStream();
     var documentUri = new Uri("pack://document.xps");
     var p = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite);
     PackageStore.AddPackage(documentUri, p);

     var xpsDoc = new XpsDocument(p, CompressionOption.NotCompressed, documentUri.AbsoluteUri);

     var dw = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
     dw.Write(doc);

     return xpsDoc.GetFixedDocumentSequence();
}[/code]
Note, that you need to add references to ReachFramework.dll and System.Printing.dll assemblies in order to compile this method.

Regards,
Meppy

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.