Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...