Crystal Reports SetParameterValue not working any more!

Brian4321

Junior Member
Jul 15, 2010
5
0
0
Hello,

In 2006, I created a Vb.Net (version 2005 Professional) windows form application that accesses a back-end MS Access database. All reports utilize the Crystal Reports that is bundled with Vb.Net.

For some reason, the below call to the SetParameterValue does not work any more. The MsgBox in the Try/Catch never appears. I've verified that the ReportStats4 is valid and the parameter is in string format. Clicking on the "report preview" tab of the report produces a good report. However, when I build and install the exe on another computer, the application fails on the SetParameterValue line. I've looked at the task manager and see the CPU usage increase. After about 60 seconds the entire application terminates and does disappears from the task manager.

Also, if I run the application from within Visual Studio developer, it works. The issue occurs when I compile and install on another CPU.

What reason would this stop working and what do I have to do to fix it?

Thanks,
Brian



Try
Dim myReport As New ReportStats4
Dim dteStartDate As DateTime
Dim dteEndDate As DateTime

dteStartDate = DateTime.Parse("7/1/2010 00:01:01")
dteEndDate = DateTime.Parse("7/15/2010 23:59:59")

myReport.SetParameterValue("FromTo", "7/1/2010 & 7/15/2010")
CrystalReportViewer1.ReportSource = myReport

CrystalReportViewer1.AutoSize = True

CrystalReportViewer1.DisplayGroupTree = False

CrystalReportViewer1.SelectionFormula = "{AuditTrail.TimeStamp} in (#" & dteStartDate & "#) to (#" & dteEndDate & "#)"

Catch ex As Exception
MsgBox("Error while trying access Crystal Reports modules: " & ex.Message)
End Try


The Crystal Reports references are shown below:

C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.CrystalReports.Engine.dll
C:\WINDOWS\assembly\GAC\CrystalDecisions.Enterprise.InfoStore\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Enterprise.InfoStore.dll
C:\WINDOWS\assembly\GAC\CrystalDecisions.Enterprise.Framework\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Enterprise.Framework.dll
C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.ReportSource.dll
C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.Shared.dll
C:\Program Files\Common Files\Business Objects\2.7\Managed\CrystalDecisions.Windows.Forms.dll
 
Last edited by a moderator:

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
Ahh...crystal reports...the bane of my existence. I've thankfully got another reporting tool and am now quickly moving away from CR as fast as I can :)

Back on topic... it really sounds like the crystal runtimes are not installed on the client computer, since it works on the development computer. Look in the computers application event logs to see if there is an error why it terminated there - usually there is. It's hard to help without any specific error message.

Are you still using 2005 pro - or a different version. CR did not come with the express versions, so maybe thats where your problem is. But then, i assume the project would not build.
 

Brian4321

Junior Member
Jul 15, 2010
5
0
0
WannaFly,

Thanks for responding so quickly. I did look in the application, security and system event viewers and there are no entries during the time I tried to run my application.

I also verified that the CR libraries are installed on the computer.

Thinking that I may have inadvertently typed something in my code, I retrieved several older versions of the application, compiled and installed them, but once again they do not work on the user's CPU.

It is almost like the Network Operations staff installed a bug patch/upgrade that is interfering with the CR part of my application.

I'll keep digging, but if anyone has any ideas, please chime in.

Thanks,
Brian
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
How do you know its that line if the program just exits without an error? Can you post a screenshot of any error messages?

CR is buggy and easy to break - but unless your NOC staff installed another version of crystal, i'd doubt thats the problem.

you can read about using Fuslogvw.exe to see if maybe there is an assembly its not finding. This has helped me fix some problems in the past, but it can be confusing and time consuming. http://msdn.microsoft.com/en-us/library/e74a18c4.aspx

I doubt it - but does the report load from a remote server? Maybe the windows firewall is blocking it, or the credentials are not valid (windows auth?)

Lastly, if you can - build a separate app with a blank report and see if it loads. That will tell you if its specific to your report or if crystal runtimes are botched.
 

Brian4321

Junior Member
Jul 15, 2010
5
0
0
WannaFly,

Although not shown in my code snippet, I had put a MsgBox ("About to execute ...") just before each of the lines of code. This is how I know the SetParameterValue line is the culprit.

Thanks for the info on Fuslogvw. I'll read up on it and see if I can use it to detect any problems. I'll also create a new app with a blank report and see if that works.

Thanks!
 

Brian4321

Junior Member
Jul 15, 2010
5
0
0
WannaFly,

I did create a blank application with a blank CR report. It runs within my development environment and as a stand alone executable on my development CPU. However, when I move the exe and other files to a different CPU without Visual Studio installed, I get the same results as below.

I'm now going to research the Fuslogvw tool.

Thanks,
Brian