cancel
Showing results for 
Search instead for 
Did you mean: 

using stored procedure (crystal report + asp.net 2003)

Former Member
0 Kudos

Hi,

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, asp.net 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)"


Try
            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.ApplyLogOnInfo(myLogin)
                        dt.Location = "myDB.dbo.Proc(cmp_Total;1)" ---> error here
                    End With
                Next
            End If

            Me.CrystalReportViewer1.ParameterFieldInfo.Clear()
            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
            Per.CurrentValues.Add(Month_Value)
            ParamFields.Add(Per)

            Me.CrystalReportViewer1.ParameterFieldInfo = ParamFields
            Me.CrystalReportViewer1.ReportSource = crReportDocument            
            Me.CrystalReportViewer1.RefreshReport()
            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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

0 Kudos

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.

Answers (0)