Crystal Reports XI - The request could not be submitted for background processing

I have a VB program (code below)  that generates a .RPT report, exports it to a PDF and emails out a link to that PDF. The program runs on Server 2003 which has the CR Engine installed (don't know how to check the version/service pack on it).

I was getting a "Load report failed" error but now I'm getting the one in the title.  When I check the Event Log I get the following message:

"Error during report execution (main try-catch): Load report failed.Error in File C:\DOCUME~1\MyUserAccount\LOCALS~1\Temp\TheReport {5E867B68-3AB8-48C0-9305-A16AF4CED465}.rpt:
The request could not be submitted for background processing..  C:\Reports"

Any ideas on what could be causing this?

I tried to go to the Business Objects site and download SP4 for the engine but pretty much all their links are broken.  As a starting point if anyone can tell me how to verify my version on the engine and give me a good link for SP4 that might do it.

Thanks for any input.


Imports System.Data
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
 
Module TheReport
 
 
    Sub Main(ByVal args() As String)
 
        Dim startdate As DateTime
        Dim enddate As DateTime
 
        If args.Length = 0 Then
            Dim evtLog As New EventLog("Application")
            evtLog.Source = "TheReport Execution"
            evtLog.WriteEntry("No Report Type Defined.", EventLogEntryType.Error)
            evtLog.Close()
            evtLog.Dispose()
            Exit Sub
        End If
 
        Dim reporttype As String = UCase(args(0))
        reporttype = (StrConv(reporttype, VbStrConv.ProperCase))
 
 
        If UCase(args(0)) = "DAILY" Then
            startdate = "#" & Today.ToShortDateString & " 00:00:00 AM#"
            enddate = "#" & Today.ToShortDateString & " 11:59:59 PM#"
        Else
            enddate = "#" & DateAdd("d", -1, Today.ToShortDateString) & " 11:59:59 PM#"
            startdate = "#" & DateAdd("d", -7, Today.ToShortDateString).ToShortDateString & " 00:00:00 AM#"
        End If
 
        Dim TodayString As String = Today.Month.ToString & "-" & Today.Day.ToString & "-" & Today.Year.ToString
        Dim LastWeek As String = DateAdd("d", -7, Today.ToShortDateString).ToShortDateString
        LastWeek = Replace(LastWeek, "/", "-")
 
 
      
        Dim rptSP As ReportDocument = New ReportDocument
 
        Try
            rptSP.Load(System.Environment.CurrentDirectory & "\TheReport.rpt", 0)
            rptSP.DataSourceConnections(0).SetConnection("MyServer\MyInstance", "MyDatabase", True)
 
            Dim vals As New CrystalDecisions.Shared.ParameterValues()
            Dim x As New CrystalDecisions.Shared.ParameterDiscreteValue()
            x.Value = startdate
            Dim y As New CrystalDecisions.Shared.ParameterDiscreteValue()
            y.Value = enddate
            vals.Add(x)
 
            rptSP.DataDefinition.ParameterFields("StartDate").ApplyCurrentValues(vals)
            vals.Clear()
            vals.Add(y)
            rptSP.DataDefinition.ParameterFields("EndDate").ApplyCurrentValues(vals)
 
            Dim norecords As Boolean = False
            Try
                If UCase(args(0)) = "DAILY" Then
                    rptSP.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "D:\Reports\" & reporttype & "MyReport" & TodayString & ".pdf")
                Else
                    rptSP.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "D:\Reports\" & reporttype & "MyReport" & LastWeek & ".pdf")
                End If
 
                If rptSP.Rows.Count = 0 Then
                    norecords = True
                    rptSP.Dispose()
                End If
                rptSP.Close()
                rptSP.Dispose()
            Catch ex As Exception
                norecords = True
                Dim evtLog As New EventLog("Application")
                evtLog.Source = "TheReport Execution"
                evtLog.WriteEntry("Error during report generation (Export To Disk Block): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                evtLog.Close()
                evtLog.Dispose()
                Try
                    rptSP.Close()
                    rptSP.Dispose()
                Catch exs As Exception
                    Dim evtLog2 As New EventLog("Application")
                    evtLog2.Source = "TheReport Execution"
                    evtLog2.WriteEntry("Error during report generation (Close/Dispose of Report): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                    evtLog2.Close()
                    evtLog2.Dispose()
                End Try
            End Try
 
            Dim mail As New System.Net.Mail.MailMessage("reportserver@mydomain.com", "test@mydomain.com")
 
            If UCase(args(0)) = "DAILY" Then
                mail.Subject = "Daily Report"
            Else
                mail.Subject = "Weekly Report"
            End If
 
            If norecords Then
                If UCase(args(0)) = "DAILY" Then
                    mail.Body = "No Seizures Entered For " & Today
                Else
                    mail.Body = "No Seizures Entered For The Week Starting " & DateAdd("d", -7, Today.ToShortDateString).ToShortDateString
                End If
            Else
                If UCase(args(0)) = "DAILY" Then
                    mail.Body = "Click the link below to access the Daily Report for " & Today & Environment.NewLine & Environment.NewLine & "http://mydomain/Reports/" & reporttype & "Report" & TodayString & ".pdf"
                Else
                    mail.Body = "Click the link below to access the Weekly Report for the week starting " & DateAdd("d", -7, Today) & Environment.NewLine & Environment.NewLine & "http://mydomain/Reports/" & reporttype & "Report" & LastWeek & ".pdf"
                End If
 
 
            End If
 
            Dim cn As New SqlConnection("Data Source=MyDatabase\MyInstance;Initial Catalog=MyDatabase;Integrated Security=SSPI;")
            Dim cmd As SqlCommand = cn.CreateCommand
            cn.Open()
            If UCase(args(0)) = "DAILY" Then
                cmd.CommandText = "SELECT emailaddy FROM theusers WHERE daily=1 "
            Else
                cmd.CommandText = "SELECT emailaddy FROM theusers WHERE weekly=1""
            End If
            Dim rdr As SqlDataReader = cmd.ExecuteReader
            While rdr.Read
                Try
                    mail.To.Add(rdr("email"))
                Catch ex As Exception
                    Dim evtLog As New EventLog("Application")
                    evtLog.Source = "TheReport Execution"
                    evtLog.WriteEntry("Error during report execution (while adding main recipients): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                    evtLog.Close()
                    evtLog.Dispose()
                End Try
 
            End While
            rdr.Close()
            cn.Close()
 
            Try
                If UCase(args(0)) = "WEEKLY" Then
                    Dim s As New IO.StreamReader("people.txt")
                    While Not s.EndOfStream
                        Try
                            mail.CC.Add(s.ReadLine)
                        Catch ex As Exception
                            Dim evtLog As New EventLog("Application")
                            evtLog.Source = "TheReport Execution"
                            evtLog.WriteEntry("Error during report execution (while adding extra people): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                            evtLog.Close()
                            evtLog.Dispose()
                        End Try
                    End While
                    s.Close()
                End If
            Catch ex As Exception
            End Try
 
            If mail.To.Count > 0 Then
                Dim smtpMe As New System.Net.Mail.SmtpClient()
                smtpMe.Host = "mysmtpserver"
                smtpMe.Send(mail)
            End If
 
        Catch ex As Exception
            Dim evtLog As New EventLog("Application")
            evtLog.Source = "TheReport Execution"
            evtLog.WriteEntry("Error during report execution (main try-catch): " & ex.Message & ex.InnerException.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
            evtLog.Close()
            evtLog.Dispose()
        Finally
            Try
                rptSP.Close()
                rptSP.Dispose()
            Catch ex As Exception
            End Try
        End Try
 
    End Sub
 
End Module

Open in new window

synapse88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
which line is causing the error?
0
synapse88Author Commented:
I can't tell that.  The only error information I have is what I posted in the question.  If there's some code I can add which will give me more exception information just let me know and I'll add it and run the program again.
0
Éric MoreauSenior .Net ConsultantCommented:
remove your try catch to debug.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

synapse88Author Commented:
I don't follow.  The Try Catch (and associated exception handling) is the only way I'm able to get the error info I posted above.  Without that it will just error out with no exception info (that I know of).
0
Éric MoreauSenior .Net ConsultantCommented:
You don't have this error on your own computer? Only when it runs on the server? If that's the case, to find out which line you can use tracing (see http://www.emoreau.com/Entries/Articles/2003/11/Code-diagnostic-an-article-on-tracing-and-debugging.aspx) or add messagebox in your application to find out which line.
0
Éric MoreauSenior .Net ConsultantCommented:
I had this error once a while ago and it was because I was missing one CR DLL file (but I don't remember which one).
0
synapse88Author Commented:
I was thinking that might be the case, that's why I was hoping someone might be able to help determining what version of the CR engine running and how to install the SP4 for it.

0
synapse88Author Commented:
Ok when I comment out the code I attached below, it works just fine
            Dim cn As New SqlConnection("Data Source=MyDatabase\MyInstance;Initial Catalog=MyDatabase;Integrated Security=SSPI;")
            Dim cmd As SqlCommand = cn.CreateCommand
            cn.Open()
            If UCase(args(0)) = "DAILY" Then
                cmd.CommandText = "SELECT emailaddy FROM theusers WHERE daily=1 "
            Else
                cmd.CommandText = "SELECT emailaddy FROM theusers WHERE weekly=1""
            End If
            Dim rdr As SqlDataReader = cmd.ExecuteReader
            While rdr.Read
                Try
                    mail.To.Add(rdr("email"))
                Catch ex As Exception
                    Dim evtLog As New EventLog("Application")
                    evtLog.Source = "TheReport Execution"
                    evtLog.WriteEntry("Error during report execution (while adding main recipients): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                    evtLog.Close()
                    evtLog.Dispose()
                End Try
 
            End While
            rdr.Close()
            cn.Close()

Open in new window

0
synapse88Author Commented:
Now the only part of the code in my post above I commented out is:

                    Dim evtLog As New EventLog("Application")
                    evtLog.Source = "TheReport Execution"
                    evtLog.WriteEntry("Error during report execution (while adding main recipients): " & ex.Message & ".  " & System.Environment.CurrentDirectory, EventLogEntryType.Error)
                    evtLog.Close()
                    evtLog.Dispose()


And it still works.  So I can only assume that this code was causing the error.  Any guesses as to why?
0
Éric MoreauSenior .Net ConsultantCommented:
>>Any guesses as to why?

I can't see how those lines relate to the error of Crystal Reports
0
synapse88Author Commented:
Neither do I.  I have the task scheduled to run on its own tonight (as opposed to me invoking it to test which is what i've been doing) so we'll see if it runs ok...
0
synapse88Author Commented:
ok so I'm starting to think it's not just the VB code I posted above.

another unrelated Crystal Report is giving me the same error now.

"Error during report execution (main try-catch): Load report failed.Error in File C:\DOCUME~1\MyUserAccount\LOCALS~1\Temp\TheReport {5E867B68-3AB8-48C0-9305-A16AF4CED465}.rpt:
The request could not be submitted for background processing

So it seems like it has something to do with that temp folder...
Anything that can help me ensure my engine is patched would be a big help.

Thanks!
0
Éric MoreauSenior .Net ConsultantCommented:
1- do you have this error when the application is running from the scheduler only or do you have it also when you run the application interactively?

2- Can you check if your installation on the server has every file? Compare the CR folder of the server with the own on your dev PC (something like C:\Program Files\Common Files\Business Objects\2.7\Bin)

0
synapse88Author Commented:
1) It's currently happening when it's running from the scheduler, or invoked by me.

2) I checked the server and the files are located in:
Program Files\Common Files\Business Objects\3.0\crystalreportviewers11
(crystalreportviewers is the only folder in the 3.0 folder)
Does the 3.0 mean that SP3 is installed?

I checked on my dev pc and the files are located in:
C:\Program Files\Business Objects\common\3.5


And I don't know any easy way to compare files between the two.  There are a high number of files folders involved.

Can anyone find a link for the SP4? I have a feeling that might be needed here.
0
Éric MoreauSenior .Net ConsultantCommented:
you can use WinDiff (http://www.grigsoft.com/download-windiff.htm) to compare folders
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
I think that I deserve the points here
0
fireprograms_techCommented:
I have a customer who was having a very similiar error message  (Error in file C:\DOCUME~1\rmarianna\lisa\temp<guid>.rpt: The request could not be submitted for background processing).  What I did to resolve this was to give Network Service everything but full control to the folder in which my application was running from (also where the reports were located) and it resolved it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.