Solved

Crystal Report Problem

Posted on 2013-12-03
5
365 Views
Last Modified: 2013-12-29
Dear All

i have a visual studio 2010 project in asp.net and there is a section for reports

my problem that when we run the report few times after that it will not work at all unless we restart the Application pool of the application

my crystal report are version :13.0.2000.0(as in web.config )

i make sure that all the connection with data base are open and close correctly

Please help
0
Comment
Question by:Kamal Khaleefa
  • 3
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39692418
Each time a report is run, you use a report connection.  Most systems are limited in the number of simultaneous connections.  When you close a report through the viewer, sometimes the report doesn't release the connection for up to 15 minutes.
 DO you close and dispose of the report objects?
If not you may be running out of connections.

Does closing the application and waiting 15 minutes allow you to rerun the application then run reports?

mlmcc
0
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 0 total points
ID: 39705763
im only diposing the connection with the data base.

here is a small code in general

  Dim cryRpt As New ReportDocument


            Dim FileName As String
            FileName = MapPath("crpMyReport.rpt")
            cryRpt.Load(FileName)


            Dim crtable As Table

            Dim crtablelogoninfo As TableLogOnInfo

            For Each crtable In cryRpt.Database.Tables
                crtablelogoninfo = crtable.LogOnInfo
                crtablelogoninfo.ConnectionInfo = cnnInfo
                crtable.ApplyLogOnInfo(crtablelogoninfo)

            Next

  Dim crParameterDiscreteValue As ParameterDiscreteValue
            Dim crParameterFieldDefinitions As ParameterFieldDefinitions
            Dim crParameterFieldLocation As ParameterFieldDefinition
            Dim crParameterValues As ParameterValues

            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
   crParameterFieldLocation = crParameterFieldDefinitions.Item("Date_From")
            crParameterValues = crParameterFieldLocation.CurrentValues
            crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue

            If Session("txtFrom") Is Nothing Then

                crParameterDiscreteValue.Value = Date.Today.AddYears(-10)
            Else

                crParameterDiscreteValue.Value = CDate(Session("txtFrom") + " 00:00:00.0")
            End If
            crParameterValues.Add(crParameterDiscreteValue)
            crParameterFieldLocation.ApplyCurrentValues(crParameterValues)

            CrystalReportViewer1.ReportSource = cryRpt

            CrystalReportViewer1.DataBind()

Open in new window

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39706059
AT a minimum you have to dispose of the cryRpt object.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39739565
Did you try disposing of the report objects?

You can't dispose of the report connection since that is internal to the report

You also didn't address my question of waiting after closing the application.

I recently was at a client where they had an issue with running out of licenses to run reports.
It turns out I wasn't logging out of the CMC (just closed IE or the page) so the connection (license) was retained.  WHen I looked it showed i (adminisstrator) was using 4 of the 5 licenses.  As soon as I logged out they freed up.

mlmcc
0
 
LVL 16

Author Closing Comment

by:Kamal Khaleefa
ID: 39744517
i didnt get the needed answer
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now