You can use Free Spire.Office to accomplish this requirement.
 
 At first, download the dlls of the library through NuGet.
 
Second, refer to the following links:
 
Export datagridview to Excel:
https://www.e-iceblue.com/Tutorials/Spire.XLS/Spire.XLS-Program-Guide/Data-Export-/Import-Export-Datatable-to-Excel-from-Database.html 
 
Export datagridview to PDF: 
https://www.e-iceblue.com/Tutorials/Spire.PDF/Demos/Table/PDF-DataSource-to-Table-C-VB.NET.html