Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type is not defined - Crystal Report

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
IE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top