Print Page | Close Window

Error with .SetDataSource Method

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2413
Printed Date: 17 Apr 2025 at 3:49pm


Topic: Error with .SetDataSource Method
Posted By: bedwell007
Subject: Error with .SetDataSource Method
Date Posted: 22 Feb 2008 at 10:52am
Problem: Running the report 2 times in row you receive the error:
"The request could not be submitted for background processing."
When running the report for the second time the follow line of code generates the error:
Report.SetDataSource(rsReport)
 
App Specs: .NET 2.0 app using Crystal Reports 9 (not the Visual Studio version)
 
Note: Same app compiled against the .NET framework 1.1, has no problems.
 
Sample Code:
 
 
Dim Report As New CRTest ' Crystal Report File
Dim RptViewer As New frmRptViewer
Dim rsReport As New ADODB.Recordset

Try

   rsReport.Fields.Append("FirstName", adVarChar, 10, adFldMayBeNull)
   rsReport.Fields.Append("LastName", adVarChar, 10, adFldMayBeNull)
   rsReport.Open()

   rsReport.AddNew()
   rsReport("FirstName").Value = "John"
   rsReport("LastName").Value = "Doe"

   Report.SetDataSource(rsReport)

   RptViewer.ReportDoc = Report
   RptViewer.ShowDialog()
   RptViewer.Dispose()

Catch ex As Exception
   MsgBox(ex.ToString)
End Try

Has anybody encountered this problem?




Replies:
Posted By: BrianBischof
Date Posted: 22 Feb 2008 at 11:05am
I haven't seen this error, but I always like to check whether you've downloaded the latest service pack to fix any bugs that they found.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: bedwell007
Date Posted: 22 Feb 2008 at 11:49am
I do have the lastest service packs for Crystal Report and .NET framework installed.



Print Page | Close Window