We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export Report as XLS

Thread ID:





123606 Apr 3,2016 06:02 PM UTC Apr 6,2016 04:20 AM UTC WPF 4
Tags: ReportViewer
Michael Faisst
Asked On April 3, 2016 06:02 PM UTC

Hi there,

I'm wondering if there is any way to expert a report loaded in a report viewer as XLS via Code. Especially because the standard report viewer has the capability to export as xls via the menu, but the
"Export" function of the ReportViewer-Object or rather the ExportType-Enumeration has no XLS-Type.

Any advice would be appreciated!


Michael Faisst
Replied On April 3, 2016 06:32 PM UTC

My bad, I meant XPS of course!

Vinoth Srinivasan [Syncfusion]
Replied On April 5, 2016 10:45 AM UTC

Hi Michael,

You can export the report to XPS by using the fixed document of the rendered report. ReportViewer has “GetFixedDocument()” that returns the FixedDocument format, it can be given as input to the XPS document generator as shown in below code sample. 

var package = Package.Open(dlg.FileName, FileMode.Create);

                    var xpsDoc = new XpsDocument(package, CompressionOption.Normal);

                    XpsDocumentWriter xpsWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);

                    // xps documents are built using fixed document sequences

                    var fixedDocSeq = new FixedDocumentSequence();

                    var docRef = new DocumentReference();





                    // write out our fixed document to xps




Also we have prepared a sample based on this and it can downloaded from the below link.


Michael Faisst
Replied On April 5, 2016 01:24 PM UTC

Hi Vinoth,

works like a charm!

Thanks very much!

Vinoth Srinivasan [Syncfusion]
Replied On April 6, 2016 04:20 AM UTC

Hi Michael

Thanks for your update.

Please let us know if you need any further assistance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon