locked
Missing Parameter Value in Crystal Report only at Client Side RRS feed

  • Question

  • User-48702869 posted

    Hi, I have migrated a project from VS2002 to VS2005. At my side the I could see all the reports with out problem but at the client side they are getting 'Missing Paramater Value'. Have compared the codes, its exactly the same but hav no idea on why it's hapening. How can I troubleshoot this problem?

    Following will be my codes on passing parameters :

    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine
    Imports System.Configuration.ConfigurationManager
    Public Class ReportViewer
        Inherits System.Web.UI.Page
        Dim strServerName As String
        Dim strUN As String
        Dim strPWD As String
        Dim rpt As String
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Response.Expires = 0
            Response.AddHeader("pragma", "no-cache")
            Response.AddHeader("cache-content", "private")
            Response.CacheControl = "no-cache"
    
            strServerName = AppSettings.Item("ServerName")
            strUN = AppSettings.Item("UserName")
            strPWD = AppSettings.Item("Password")
            rpt = Request.QueryString("rpt")
    
            BindReport()
        End Sub
    Private Sub BindReport()
            Dim arr As ArrayList
            arr = Session("Param")
            Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
            Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
            Dim dbConn As TableLogOnInfo = New TableLogOnInfo
            Dim oRpt As ReportDocument = New ReportDocument
            Dim arrTables As Object() = New Object(0) {}
            ReDim arrTables(2)
    
            oRpt.Load(Server.MapPath(rpt)) 
            crDatabase = oRpt.Database
            crDatabase.Tables.CopyTo(arrTables, 0)
            crTable = DirectCast(arrTables(0), CrystalDecisions.CrystalReports.Engine.Table)
            dbConn = crTable.LogOnInfo
            dbConn.ConnectionInfo.DatabaseName = ""
            dbConn.ConnectionInfo.ServerName = strServerName
            dbConn.ConnectionInfo.UserID = strUN
            dbConn.ConnectionInfo.Password = strPWD
            crTable.ApplyLogOnInfo(dbConn)
    
    		
            Select Case rpt
                Case "WellSample.rpt", "WellSampleStorage.rpt", "WellSampleTS.rpt", "WellSampleTType.rpt"
                    oRpt.SetParameterValue(0, arr.Item(0))  'Max Dep
                    oRpt.SetParameterValue(1, arr.Item(1))  'Min Dep
                    oRpt.SetParameterValue(2, arr.Item(2))  'Set No.
                    oRpt.SetParameterValue(3, arr.Item(3))  'SMP Code
                    oRpt.SetParameterValue(4, arr.Item(4))  'Well Name
    
    End Select
    
            Me.CrystalReportViewer1.ReportSource = oRpt
    
        End Sub
    End Class

    Im stuck... Please help... Cry

    Wednesday, August 24, 2011 3:10 AM

All replies

  • User705563967 posted

    In crystal report you should provide all paramater it will used or not used.Some paramter base on senerio so should define default values for this parameter like

      oRpt.SetParameterValue(0, arr.Item(0))  'Max Dep
                    oRpt.SetParameterValue(1, arr.Item(1))  'Min Dep
                    oRpt.SetParameterValue(2, arr.Item(2))  'Set No.
                    oRpt.SetParameterValue(3, arr.Item(3))  'SMP Code
                    oRpt.SetParameterValue(4, arr.Item(4))  'Well Name
                   oRpt.SetParameterValue(5,'###') 
    
    
    Wednesday, August 24, 2011 3:41 AM
  • User-48702869 posted

    Sorry can't get what you really mean. What will be the result in adding oRpt.SetParameterValue(5,'###')?  There is only 4 paramateres being passed here.

    Wednesday, August 24, 2011 3:51 AM
  • User-48702869 posted

    In crystal report you should provide all paramater it will used or not used.Some paramter base on senerio so should define default values for this parameter like

      oRpt.SetParameterValue(0, arr.Item(0))  'Max Dep
                    oRpt.SetParameterValue(1, arr.Item(1))  'Min Dep
                    oRpt.SetParameterValue(2, arr.Item(2))  'Set No.
                    oRpt.SetParameterValue(3, arr.Item(3))  'SMP Code
                    oRpt.SetParameterValue(4, arr.Item(4))  'Well Name
                   oRpt.SetParameterValue(5,'###') 
    
    

    I got this error "Error in File C:\DOCUME~1\KOMPAK~1\ASPNET\LOCALS~1\Temp\WellSample {1CAAB51B-8E74-4224-881F-0FA865C412FF}.rpt: Operation illegal on linked parameter" after adding the line you asked me to, so have removed it.

    I tried to publish the project and run it from IIS. I got the same error when passing the parameter at the very first parameter. But if I run the published folder at the IE (localhost). It works well.

    I have restarted my IIS and cleared my browser cache, temp file and even history (as per my senior suggestion) and run. It still the same. Is there a solution for this?

    Thank you in advance. Cool

    Thursday, September 15, 2011 5:30 AM
  • Tuesday, September 27, 2011 1:49 AM