Results 1 to 2 of 2

Thread: [Resolved] VB .Net 2003 Crystal Reports 10 question

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    [Resolved] VB .Net 2003 Crystal Reports 10 question

    Anyone know why the following code is giving me an error?

    VB Code:
    1. Imports CrystalDecisions.CrystalReports.Engine
    2. Imports CrystalDecisions.Shared
    3. Imports System.IO
    4. Dim crpt As New ReportDocument
    5.  
    6. crpt.Load("C:\VB.Net Programs\Fuel Report\FuelRpt.rpt")
    7.         For Each myTable In crpt.Database.Tables
    8.             myLogin = myTable.LogOnInfo
    9.             With myLogin.ConnectionInfo
    10.                 .ServerName = "202.101.8.107"
    11.                 .UserID = "sa"
    12.                 .Password = ""
    13.                 .DatabaseName = "Daily"
    14.             End With
    15.             myTable.ApplyLogOnInfo(myLogin)
    16.         Next
    17.         crpt.RecordSelectionFormula = "{DailyFuelView.DateSold} = Date (" & strDate & ")"
    18.         CrystalReportViewer1.ReportSource = crpt
    19.         crpt.DataDefinition.FormulaFields.Item("Text5").Text = Format(dblFuel, "#,00.00")

    I'm getting an error on the very last statement. Everything else works fine.

    The error message is: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in crystaldecisions.crystalreports.engine.dll

    Additional information: Invalid index.

    Thanks
    Last edited by indydavid32; Jul 19th, 2004 at 11:27 AM.
    David Wilhelm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width