Search code examples
crystal-reports

Crystal Report Export to excel using suppress


I have a problem with exporting rpt file to excel, My requirement is to: Display page numbers when printing from a Crystal Report (rpt) file and Suppress the page number when exporting this to excel, I am having trouble with the suppression and need help.


Solution

  • One way you can achieved by creating a static parameter as ExportFormat and put two value as 'default' and another one 'excel'..

    Then add this parameter to your report with any string field notequalto the parameter..

    finally in the PageNumber field in the suppress put this formula

    if {?ExportFormat} = 'excel' then true else false

    When ever user want to export to excel select "excel" if user want to view in crystal or any other export format select default..So that page number will suppress only when user select export format as 'excel'...