We help IT Professionals succeed at work.
Get Started

Crytal Reportd causing an untrappable error.

523 Views
Last Modified: 2012-05-12
Hello All

Well I'm creating a VB.Net application that is using Crystal Reports everything runs fine on my development machine but when I installed it on a another computer and I go to run a report and the program generates an un-trappable error. The line that is causing the error is cryRpt.SetDataSource(DS.Tables("WorkOrder")). If anyone can see something that I'm doing wrong or offer suggestions I would greatly appreciate it. My code is below.

DC




            MsgBox("1")
            SelectCommand = WOListSelectCommand(strLimit)
            MsgBox("2")
            WODataAdapter = New OleDbDataAdapter(SelectCommand, ConString)
            MsgBox("3")
            Dim CommandBuilder As New OleDbCommandBuilder(WODataAdapter)
            MsgBox("4")
            WODataAdapter.Fill(DS, "WorkOrder")
            MsgBox("5")

            cryRpt.Load(ReportPath & "rptWOListSingle.rpt")
            MsgBox("6")
            MsgBox("Rows Found: " & DS.Tables("WorkOrder").Rows.Count.ToString)
            cryRpt.SetDataSource(DS.Tables("WorkOrder"))
            MsgBox("7")
            If OpenArgs = "WOBOARD" Then
                cryRpt.SummaryInfo.ReportTitle = "Work Order Listing"
            Else
                cryRpt.SummaryInfo.ReportTitle = "Work Order Listing for " & rTitle
            End If
            MsgBox("8")
            crParameterDiscreteValue.Value = strLimit
            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
            crParameterFieldDefinition = crParameterFieldDefinitions.Item("Limits")
            crParameterValues = crParameterFieldDefinition.CurrentValues
            crParameterValues.Clear()
            crParameterValues.Add(crParameterDiscreteValue)
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
            MsgBox("9")

            crParameterDiscreteValue.Value = Main.qbCompanyName
            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
            crParameterFieldDefinition = crParameterFieldDefinitions.Item("CompanyName")
            crParameterValues = crParameterFieldDefinition.CurrentValues
            crParameterValues.Clear()
            crParameterValues.Add(crParameterDiscreteValue)
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
            MsgBox("10")

Comment
Watch Question
Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE