Search code examples
devexpressxtrareport

Exporting a DevExpress XtraReport to Text page by page


I would like to be able to export only the first page of an XtraReport to text. I can see how to do it when exporting to HTML (or various other formats) using the exportoptions. I can't see any way to do it when exporting to text though.

Any ideas?


Solution

  • Answer from DevExpress:

    Thank you for contacting us. To accomplish this task, you can use the Page Merging technique. Refer to the How to: Merge Pages of Two Reports article for additional information. See the code below:

    [VB.NET]

    Dim report As New XtraReport1()
    report.CreateDocument()
    
    Dim ps As New PrintingSystem()
    ps.Pages.Add(report.Pages(0))
    ps.ExportToText(file)
    

    It worked perfectly.