Instead of viewing reports in the browser using the interactive HTML-based viewer, ReCrystallize Server can export Crystal Reports directly to a file. To export a report, add the
exportfmt=
or equivalent
exttyp=
parameter to the URL or include it as a field when POSTing a form to ReCrystallize Server’s viewreport.aspx page.
The following export formats are available:
File format | File extension | Exportfmt value |
---|---|---|
Adobe Acrobat | ||
Comma Separated Values | .csv | CSV |
Crystal Reports | .rpt | RPT |
Crystal Reports protected / read only | .rptr | RPTR |
Editable Rich Text | .rtf | EDITABLERTF |
Excel 97-2003 | .xls | EXCEL |
Excel 2007-2016 | .xlsx | EXCELWORKBOOK |
Excel Data Only (without formatting) | .xls | EXCELDATA |
Excel Data Only with Maintain Relative Object Position | .xls | EXCELDATAMAINTAINPOS |
Microsoft Word | .doc | WORD |
Rich Text | .rtf | RTF |
Tab Separated Text | .ttx | TAB |
Text | .txt | TEXT |
XML | .xml | XML |
HTML 4 only support6ed for saving to disk. | .html | HTML |
For example, to export a report to PDF format the URL would be similar to
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF
The exported file will open in the browser or be saved to disk, based on the client browser configuration. To request the exported file to be treated as a download and saved to disk, include the option download parameter with a value of YES or TRUE.
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF&download=y
As with parameter values, the export format may be posted from a form rather than included in the link.
To specify a filename for downloaded files, include exportname in the request. The filename may be a literal string or may use substitutions of parameter values enclosed with tildes. The following examples produce the same results:
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF&download=y&exportname=Shakespeare
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF&download=y&exportname=*author*
To append the current date and time to a filename for downloaded files, include DATE as part of exportname in the request.
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF&download=y&exportname=MyReport~DATE~
To redirect the browser to another web address, include redirect=.
ViewReport.aspx?reportName=library.rpt&author=Shakespeare&exportfmt=PDF&download=y&redirect=http://www.recrystallize.com
Post your comment on this topic.