Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Crystal report crashes Post Reply Post New Topic
Author Message
Adagio
Newbie
Newbie
Avatar

Joined: 17 May 2007
Online Status: Offline
Posts: 11
Quote Adagio Replybullet Topic: Crystal report crashes
    Posted: 07 Oct 2008 at 1:56am
After upgrading Visual Studio 2005 to 2008 we started getting problems with Crystal Report on a few machines (unfortunately I haven't been able to replicate the problem on my own computer)

The problem happens when creating a report. I get the following exceptions:

Message: Object reference not set to an instance of an object.
StackTrace:    at CrystalDecisions.CrystalReports.Engine.ReportClass.Dispose(Boolean bDisposeManaged)
   at CrystalDecisions.CrystalReports.Engine.ReportClass.Finalize()


And

Message: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
StackTrace:    at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()
   at CrystalDecisions.CrystalReports.Engine.ReportClass..ctor()
   at Andresen.rptQrapport..ctor()
   at Andresen.Applications.Qsys.Tools.QrapportGenerator.MakeReport()


The computers where these exceptions occurs does have the version of Crystal Reports that comes with Visual Studio 2008

Does anyone know what could be the problem?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 07 Oct 2008 at 9:24am
I don't know, but I see that one error is being called by the MakeReport() method. Is it possible that the user doesn't have full Admin access to all the folders and therefore can create the temporary files necessary to bulid the report? Just a hunch.
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>
IP IP Logged
Adagio
Newbie
Newbie
Avatar

Joined: 17 May 2007
Online Status: Offline
Posts: 11
Quote Adagio Replybullet Posted: 08 Oct 2008 at 3:52am
The users has the same rights as before we converted to VS2008 and all users has the same rights, but not all users gets this problem

MakeReport looks like this:


private rap as CrystalReport1
Private t As New List(Of Test)

public sub new(lst as list (of Test))
        t = lst

        MakeReport
end sub

private sub MakeReport
        rap = New CrystalReport1

        rap.SetDataSource(t)
end sub

IP IP Logged
Adagio
Newbie
Newbie
Avatar

Joined: 17 May 2007
Online Status: Offline
Posts: 11
Quote Adagio Replybullet Posted: 20 Oct 2008 at 12:58am
Still having this problem

The exception is thrown in this line:

rap = New CrystalReport1

And New() in CrystalReport1 looks like this:

Public Sub New()
        MyBase.New
End Sub

Which makes it very difficult to something in code to avoid this. CrystalReport1 is an empty document, so no fancy features in that one
IP IP Logged
Adagio
Newbie
Newbie
Avatar

Joined: 17 May 2007
Online Status: Offline
Posts: 11
Quote Adagio Replybullet Posted: 23 Oct 2008 at 7:05am
Nobody? This problem is driving me nuts

I tried reinstalling Crystal Reports on the machine, but no luck

After doing a quick check on the source code for the report class I noticed nothing special. No sign of where it could throw an exception. The inner exception message says the exception is thrown in a Dispose method of the report class, but why is Dispose called during initializing of the report document? On my own computer (importing the source code from report class to debug that area) debugging through this report class shows no sign of wanting to dispose anything
IP IP Logged
Adagio
Newbie
Newbie
Avatar

Joined: 17 May 2007
Online Status: Offline
Posts: 11
Quote Adagio Replybullet Posted: 29 Oct 2008 at 5:03am
This problem is still haunting me, so I tried using FileMon to see what was going on when the report is made

What we know so far:
When the Administrator logs in, the report is created without any problems
When a user logs in, the report fails during Sub New

So using FileMon on the same machine, one as Administrator and one as a user I found these differences:

Administrator:
85    10:47:37    csrss.exe:508    QUERY INFORMATION    C:\Programmer\Business Objects\Common\2.8\bin\da-DK    NOT FOUND    Attributes: Error    
86    10:47:37    csrss.exe:508    QUERY INFORMATION    C:\Programmer\Business Objects\Common\2.8\bin\da    NOT FOUND    Attributes: Error    
87    10:47:37    csrss.exe:508    QUERY INFORMATION    C:\Programmer\Business Objects\Common\2.8\bin\    SUCCESS    Attributes: D    
88    10:47:37    csrss.exe:508    QUERY INFORMATION    C:\Programmer\Business Objects\Common\2.8\bin\    SUCCESS    Attributes: D    

User:
90    10:24:44    csrss.exe:508    QUERY INFORMATION    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\da-DK    NOT FOUND    Attributes: Error    
91    10:24:44    csrss.exe:508    QUERY INFORMATION    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\da    SUCCESS    Attributes: D    
92    10:24:44    csrss.exe:508    QUERY INFORMATION    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\    SUCCESS    Attributes: D    
93    10:24:44    csrss.exe:508    QUERY INFORMATION    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\    SUCCESS    Attributes: D

A clear difference is the folder used here. In the working situation in uses Business Objects folder under Program Files, the not working situation it uses the Framework folder in Windows

Also in the working situation it calls a file called Microsoft.VC90.ATL.mui.DLL, while when it doesn't work it uses Microsoft.VC80.CRT.mui.DLL

And remember this is the same computer, only difference is user rights
IP IP Logged
memoryofadream
Newbie
Newbie
Avatar

Joined: 05 Sep 2012
Location: Romania
Online Status: Offline
Posts: 1
Quote memoryofadream Replybullet Posted: 06 Sep 2012 at 12:03am
What was you solution to this Adagio?
I seem to be confronted with a similar issue, however it's not different users which are affected, rater different applications, run by the same user on the same PC.
One works fine, while the other gets this reference not set exception on crystal reports instantiation.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.