Search code examples
vb.netcrystal-reports

Is there a way to automatically generate and export a PDF with VB.NET using Crystal Reports?


I just want to save some time and not go through the process of having to press export, name the pdf and choose a folder every time. But I am having a hard time finding a way to automatically export a pdf to a specific folder using vb.net and crystal reports. I know that if I use reportdocument.PrintToPrinter(1, False, 0, 0) it will automatically print. Is there an equivalent to this, but with exporting a pdf to a specific folder?


Solution

  • According to the docs it can be achieved like so:

    reportdocument.ExportToDisk(ExportFormatType.PortableDocFormat, exportPath + "Filename.pdf")