Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / October 2004

Tip: Looking for answers? Try searching our database.

Crystal Reports exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
OzSoft - 22 Oct 2004 21:21 GMT
I am receiving the following exception randomly when printing crystal reports
via a
print server application.  The server will successfullky print a random
number of identical files and then for some reason, the following exception
is logged.

System.InvalidOperationException: Stack empty.
  at System.Collections.Stack.Pop()
  at SCRStartup.Leave()
  at CrystalDecisions.CrystalReports.Engine.ReportObjects..ctor(SCRPrintJob
printJob, Int32 sectionCode)
  at CrystalDecisions.CrystalReports.Engine.ReportObjects.GetEnumerator()
  clsReports.LogInReport()

The code for LogInReport is as follows

       Dim ret As Boolean = False
       Dim repDoc As New ReportDocument
       Dim subRepDoc As New ReportDocument
       Dim crSections As Sections
       Dim crSection As Section
       Dim crReportObjects As ReportObjects
       Dim crReportObject As ReportObject
       Dim crSubReportObject As SubreportObject
       Dim crDatabase As Database
       Dim crTables As Tables
       Dim crTable As Table
       Dim crConnInfo As New ConnectionInfo
       Dim crLogOnInfo As New TableLogOnInfo
       Try
           repDoc.Load(mstrFile, OpenReportMethod.OpenReportByDefault)

           With crConnInfo
               .ServerName = mstrServer
               .DatabaseName = mstrDatabase
               .UserID = mstrUserName
               .Password = mstrPassWord
           End With

           'we iterate through the report database tables and log the user in
           crDatabase = repDoc.Database
           crTables = crDatabase.Tables
           For Each crTable In crTables
               crLogOnInfo = crTable.LogOnInfo
               crLogOnInfo.ConnectionInfo = crConnInfo
               crTable.ApplyLogOnInfo(crLogOnInfo)
           Next

           crSections = repDoc.ReportDefinition.Sections
           For Each crSection In crSections
               crReportObjects = crSection.ReportObjects
               For Each crReportObject In crReportObjects
                   If crReportObject.Kind =
ReportObjectKind.SubreportObject Then
                       crSubReportObject = CType(crReportObject,
SubreportObject)
                       subRepDoc =
crSubReportObject.OpenSubreport(crSubReportObject.SubreportName)
                       crDatabase = subRepDoc.Database
                       crTables = crDatabase.Tables
                       For Each crTable In crTables
                           crLogOnInfo = crTable.LogOnInfo
                           crTable.LogOnInfo.ConnectionInfo = crConnInfo
                           crTable.ApplyLogOnInfo(crTable.LogOnInfo)
                       Next
                   End If
               Next
           Next
           ret = True
       Catch ex As Exception
           EventLog.WriteEntry(AppName, ex.ToString, EventLogEntryType.Error)
       End Try
       Return ret

Any ideas?

TIA
OzSoft - 27 Oct 2004 19:05 GMT
This is an issue with Crystal running on dual processor machines.  To resolve
the issue you have to bring up Task Manager, select your application, right
click and set affinity.  Set your application up to run only on one CPU.

> I am receiving the following exception randomly when printing crystal reports
> via a
[quoted text clipped - 73 lines]
>
> TIA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.