type is not defined - Crystal Report

cathiec

Active member
Joined
Mar 8, 2004
Messages
28
Hi!

I am trying to export to PDF using vb.net and crystal.

here is the code that i am using:

Private Sub Export()

Dim ExportPath As String = Request.PhysicalApplicationPath

Dim crReportDocument As CrystalReport1 = New CrystalReport1()
crReportDocument.SetDataSource(Me.DataSet1)


crDiskFileDestinationOptions = New DiskFileDestinationOptions
crExportOptions = crReportDocument.ExportOptions
Session("filename") = Session.SessionID.ToString() & ".pdf"
crDiskFileDestinationOptions.DiskFileName = ExportPath & Session("filename").ToString()
crExportOptions.DestinationOptions = crDiskFileDestinationOptions
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
crReportDocument.Export()
Response.Redirect("WebForm2.aspx")

End Sub

i have imported the crytal namespaces that i need and i have added references to the project too.

i have a crystal report called CrystalReport1 also.

but i keep getting the error "Type CrystalReport1 is not defined"

Would really appreciate any help on this.

thanks and regards
 
Back
Top