How can I add a button to a Microsoft Access report to export it to Excel / PDF?
Modules: Sample Excel Automation - cell by cell which is slow
Modules: Transferring Records to Excel with Automation
Note though the Excel automation suggested is actually against a query as exporting reports to Excel makes them exceedingly ugly. If I recall correctly this feature was removed in Access 2007.
A2000ReportToPDF is an Access 2000 database containing a function to convert Reports and Snapshot files to PDF documents. No PDF Printer driver is required. Free.
AFAIK you can't "add" it to the report. But on the form that opens the report, you could add a button with the following code:
DoCmd.OutputTo acOutputReport, "ReportName", acFormatXLS,
"c:\YourFolderName\ReportName - " & Format(Date, "yyyymmdd") & ".xls"
Only Access 2007 has support for PDF's. So you will either need to install a PDF printer or use Tony Toews suggestion
Christian has suggested a command button on a form, but you could also create a toolbar for the report with a button on it that would export the report to Excel. But as Tony says, the results are going to be ugly.
I would say that more useful would be a button that exports the data displayed in the report to an Excel spreadsheet. Formatting wouldn't be as pretty, but it would be much more useful and manipulable. For that, you'd use DoCmd.TransferSpreadsheet and a saved Query as your export source (equivalent to the Recordsource of the report).