User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,713 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,210 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 20735 | Replies: 1
Reply
Join Date: Mar 2005
Posts: 7
Reputation: deeraj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
deeraj's Avatar
deeraj deeraj is offline Offline
Newbie Poster

Problem with Crystal Report in ASP.NET

  #1  
Jun 6th, 2005
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2005
Posts: 175
Reputation: Letscode is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 5
Letscode's Avatar
Letscode Letscode is offline Offline
Junior Poster

Re: Problem with Crystal Report in ASP.NET

  #2  
Jun 14th, 2005
Check out the business objects Website...for help on Crystal reports
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 12:52 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC