The MindFusion Forums
https://mindfusion.eu/Forum/YaBB.pl
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 3:41am

Title: DocumentViewer's search function does not work
Post by luolishuang on May 3rd, 2013 at 3: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 7: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();
}

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.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.