944,087 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 29538
  • ASP.NET RSS
Jun 6th, 2005
0

Problem with Crystal Report in ASP.NET

Expand Post »
Hi,
I am developing an ASP.NET application which uses Crystal reports 9. It was
working fine. But later I installed the trial Crystal Report 11. After that
the generating of the reports gives the folowing error

"System.Runtime.InteropServices.COMException: Not enough memory for
operation."

The change of version may not be the actual cause but I cant trace out what
other change I might have done to cause this.

This is my code :
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Web
----------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim RptFilePath As String
Dim ReportDoc As New ReportDocument
Dim RptExportOpt As CrystalDecisions.Shared.ExportOptions
Dim ExportLocation As New
CrystalDecisions.Shared.DiskFileDestinationOptions
Dim ExportPath As String

RptFilePath = "C:\Report1.rpt"

'this is the line that gives the error:
ReportDoc.Load(RptFilePath)

ReportDoc.Refresh()
ReportDoc.SetDatabaseLogon("myuser", "mypwd", "myserver", "myDB")
ReportDoc.SetParameterValue("From", "qwe")
ReportDoc.SetParameterValue("To", "asd")
' two parameters that are passed to the report

ExportPath = "C:\report.pdf"
ExportLocation.DiskFileName = ExportPath
RptExportOpt = ReportDoc.ExportOptions
With RptExportOpt
.DestinationOptions = ExportLocation
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With

ReportDoc.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(ExportPath)
Response.Flush()
Response.Close()
System.IO.File.Delete(ExportPath)
End Sub
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
deeraj is offline Offline
7 posts
since Mar 2005
Jun 14th, 2005
0

Re: Problem with Crystal Report in ASP.NET

Check out the business objects Website...for help on Crystal reports
Reputation Points: 11
Solved Threads: 6
Junior Poster
Letscode is offline Offline
175 posts
since Feb 2005
Oct 31st, 2008
0

Re: Problem with Crystal Report in ASP.NET

Try installing the full version of crystal XI. It must work. I had the same problem when I installed the trial version, from crystal IIX. Once I got the non-trial version, everything went back to normal. Gd luck.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
dotyell is offline Offline
9 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC