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 / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

properly close crystal report object?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 24 Mar 2008 20:31 GMT
Howdy,

in a .net 2.0 application using crystal reports for visual studio 2005, my
users get the following error

System.Exception: Load report failed. --->
System.Runtime.InteropServices.COMException (0x80041016): The maximum report
processing jobs limit configured by your system administrator has been
reached. at
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&
DocumentPath, Int32 Options) at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&
DocumentPath, Int32 Options) at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
--- End of inner exception stack trace --- at
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String
filename, OpenReportMethod openMethod, Int16 parentJob) at
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at servicepartnerdispatch.Page_Load(Object sender, EventArgs e)

I've updated the registry to boost up the PrintJobLimit
(HKLM\SOFTWARE\CRYSTAL DECISIONS\10.2\Report Application Server\Server) to
175 and that works better. This application is currently in development, so
only a handful of users are accessing this and running even fewer reports.
All reports are being generated into PDF on the fly. I'm guessing I'm not
closing the object correctly? What am I missing? Shouldn't the engine release
the job once it's completed? Below is my code for a report

Dim crReport As New ReportDocument
           Dim path As String =
Server.MapPath("rptServicePartnerDispatch.rpt")
           crReport.Load(path)
           Dim woid As Integer = Request("WOID")
           Dim comp As String = Request("COMP")
           Dim job As String = Request("JOB")

           Dim ds As New DataSet
           Dim adap As New SqlDataAdapter("cp_FrmServicePartnerDispatch",
conn)

           With adap
               .SelectCommand.CommandType = CommandType.StoredProcedure
               .SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))
           End With

           conn.Open()
           adap.Fill(ds, "cp_FrmServicePartnerDispatch")

           crReport.SetDataSource(ds)

           Dim strStream As New
System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat))

           Response.ClearContent()
           Response.ClearHeaders()
           Response.ContentType = "application/pdf"
           
Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))

           Response.Flush()
           Response.Close()

           conn.Close()

Thanks!
Signature

David Lozzi
Delphi Technology Solutions
Blog: www.lozzi.net

George Ter-Saakov - 24 Mar 2008 20:53 GMT
crReport (ReportDocument) object has a Dispose method.....

You must call Dispose method when you done with object....
Not only Crystal, but FileStream, Database Connection....Any object that
supports IDisposable interface

George.

> Howdy,
>
[quoted text clipped - 67 lines]
>
> Thanks!

Rate this thread:







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.