Ecco un semplice script che permette di generare un report in vari formati con un datasource e aprire il file creato:

 
Public Shared Function CreateOpenReport(ByVal ReportName As String, ByVal dsReport As DataSet, ByVal FileName As String, ByVal ExportType As CrystalDecisions.Shared.ExportFormatType) As Boolean
 
    Dim rep As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim ReportPath As String = ""
  
    ReportPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\Reports"
    rep.Load(ReportPath + "\" + ReportName + ".rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy)
    rep.SetDataSource(dsReport)
 
    Dim FilePath As String = ""
    Dim ExportFileName As String = ""
 
    FilePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\DOCUMENTI"
 
    Select Case ExportType
        Case CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
            ExportFileName = String.Format("{0}\{1}.pdf", FilePath, FileName)
 
        Case CrystalDecisions.Shared.ExportFormatType.CrystalReport
            ExportFileName = String.Format("{0}\{1}.rpt", FilePath, FileName)
        Case CrystalDecisions.Shared.ExportFormatType.Excel
            ExportFileName = String.Format("{0}\{1}.xls", FilePath, FileName)
        Case CrystalDecisions.Shared.ExportFormatType.ExcelRecord
            ExportFileName = String.Format("{0}\{1}.xls", FilePath, FileName)
        Case CrystalDecisions.Shared.ExportFormatType.HTML32, CrystalDecisions.Shared.ExportFormatType.HTML40
            ExportFileName = String.Format("{0}\{1}.html", FilePath, FileName)
        Case CrystalDecisions.Shared.ExportFormatType.RichText
            ExportFileName = String.Format("{0}\{1}.rtf", FilePath, FileName)
        Case CrystalDecisions.Shared.ExportFormatType.WordForWindows
            ExportFileName = String.Format("{0}\{1}.doc", FilePath, FileName)
 
        Case Else
            ExportFileName = String.Format("{0}\{1}.rpt", FilePath, FileName)
 
    End Select
 
  
    If Not System.IO.Directory.Exists(FilePath) Then
        System.IO.Directory.CreateDirectory(FilePath)
    End If
    If System.IO.File.Exists(ExportFileName) Then
        System.IO.File.Delete(ExportFileName)
    End If
    rep.ExportToDisk(ExportType, ExportFileName)
 
    Dim Proc As New System.Diagnostics.Process
 
    Proc.StartInfo.FileName = ExportFileName
    Proc.Start()
 
End Function