Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DocumentViewer's search function does not work (Read 5985 times)
luolishuang
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Joined: Feb 22nd, 2013
DocumentViewer's search function does not work
May 3rd, 2013 at 2:41am
Print Post  
The lower left corner of the search function in DocumentViewer can not be used,Can this be solved??
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: DocumentViewer's search function does not work
Reply #1 - May 3rd, 2013 at 6:01am
Print Post  
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
Select All
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
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint