System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello -

Im trying to run a very simple report - this is my first time using crystal reports. I keep getting the following error upon running the application.
"A first chance exception of type System.Runtime.InteropServices.COMException occurred in CrystalDecisions.CrystalReports.Engine.dll"
I have one parameter Im calling "SSN".

This is driven by a form:

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Imports CrystalDecisions.CrystalReports.Engine
<span style="color:Blue; Imports CrystalDecisions.<span style="color:Blue; Shared


<span style="color:Blue; Public <span style="color:Blue; Class Form1
<span style="color:Blue; Private <span style="color:Blue; Sub Button1_Click(<span style="color:Blue; ByVal sender <span style="color:Blue; As System.Object, <span style="color:Blue; ByVal e <span style="color:Blue; As System.EventArgs) <span style="color:Blue; Handles Button1.Click
<span style="color:Blue; Dim cryRpt <span style="color:Blue; As <span style="color:Blue; New ReportDocument
cryRpt.Load(<span style="color:#A31515; "C:UsersDIW07DocumentsVisual Studio 2008ProjectsGet Employer Info For PearlGet Employer Info For PearlCrystalReport1.rpt")

<span style="color:Blue; Dim crParameterFieldDefinitions <span style="color:Blue; As ParameterFieldDefinitions
<span style="color:Blue; Dim crParameterFieldDefinition <span style="color:Blue; As ParameterFieldDefinition
<span style="color:Blue; Dim crParameterValues <span style="color:Blue; As <span style="color:Blue; New ParameterValues
<span style="color:Blue; Dim crParameterDiscreteValue <span style="color:Blue; As <span style="color:Blue; New ParameterDiscreteValue

crParameterDiscreteValue.Value = TextBox1.Text
crParameterFieldDefinitions = _
cryRpt.DataDefinition.ParameterFields()
crParameterFieldDefinition = _
crParameterFieldDefinitions.Item(<span style="color:#A31515; "SSN")
crParameterValues = crParameterFieldDefinition.CurrentValues

crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()






<span style="color:Blue; End <span style="color:Blue; Sub


<span style="color:Blue; End <span style="color:Blue; Class
[/code]





View the full article
 
Back
Top