Skip to Content
avatar image
Former Member

using stored procedure (crystal report + 2003)


Am getting this below error.

Error in File
nb888p\Proj\Report\ABC.rpt: Invalid table number.

I am having 10 reports all work fine except one which is using one stored procedure.

I am using CR 8.5, 2003. I am trying to load report in my project which was designed by someone else.

On my CR, when i check Database -> Set Location , it has under 'Databases' one table and one stored procedure ,i.e.,

myDB.dbo.chn_2008 - which is table

myDB.dbo.Proc(cmp_Total;1) - which is stored procedure.

Below is my code.

Am getting error here -->dt.Location = "myDB.dbo.Proc(cmp_Total;1)"

            Dim crReportDocument As New ReportDocument
            crReportDocument.Load(gbVariables.strDocPathFolder + "\" + "ABC.rpt")
            Dim myLogin As TableLogOnInfo
            Dim strTableName As String
            Dim subRpt As ReportDocument
            If Not crReportDocument Is Nothing Then
                myLogin = New TableLogOnInfo
                With myLogin.ConnectionInfo
                    .ServerName = "Sname"
                    .UserID = "uid"
                    .Password = "pwd"
                    .DatabaseName = "myDB"
                End With
                Dim dt As Table
                For Each dt In crReportDocument.Database.Tables
                    With dt
                        dt.Location = "myDB.dbo.Proc(cmp_Total;1)" ---> error here
                    End With
            End If

            Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo

            'Set Month Paramter
            Dim GetMonthValues As Int16
            GetMonthValues = Session("Month")
            Dim Per As New ParameterField
            Per.ParameterFieldName = "@Month"
            Dim Month_Value As New ParameterDiscreteValue
            Month_Value.Value = GetMonthValues

            Me.CrystalReportViewer1.ParameterFieldInfo = ParamFields
            Me.CrystalReportViewer1.ReportSource = crReportDocument            
            Me.CrystalReportViewer1.Visible = True
        Catch ex As Exception
            lblError.Text = ex.Message.ToString
        End Try

Thanks to help...

Edited by: Mohamed Yasin Ismail on Oct 21, 2008 8:18 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 21, 2008 at 01:40 PM

    Oh man, I have the same problem. Is there any solution?

    Add comment
    10|10000 characters needed characters exceeded

    • You are using RDC as the report engine and Viewer, we have done no testing in .NET so we can't assist you.

      Suggest you upgrade to a higher version of CR which includes .NET assemblies that will work.