in Search
ATTENTION: I've decided to put the upgrade on hold due to a compatibility issue of our server environment with the latest CS installer package. CS 2008 now requires SQL Server 2005 as the backend DB but our database server currenlty has SQL Server 2000 installed on it. I'll resume the upgrade once I figure out when Telligent is releasing a patch to the schema compatibility issue. For now, we will continue to use the old version of CS while waiting for the said patch. If you have any questions about this process, please don't hesitate to post them on our forums and I'll answer them as soon as I can. Thanks for your patience and support guys! I'll let you know as soon as this is resolved. - Keith Rull
Latest post 08-06-2008 10:51 AM by joe. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 08-06-2008 10:51 AM

    • joe
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 1
    • Points 5

    Missing parameter values.

    Hi, Pls am new in crystal report in ASP.NET 2008 (usign VB codes). I created a CR using dataset (DataTable). Tested it with an SQL statement and it displays data. When I remove the direct where clause conditions to use parameter (because i will display the parameter as header information), it is giving me "Missing parameter values." Can someone help me. The code is below:

     

       Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim ConnectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
            Dim conn As New OracleConnection(ConnectionString)
            Dim MyDA As New OracleClient.OracleDataAdapter
            Dim vacancyid As Integer = Request.QueryString("vacancyid")
            Dim sql As String = ""
                    Dim cmd As New OracleCommand(sql, conn)
            sql = "select  a.VACANCY_ID,a.VAC_TITLE,a.PUBLISH_SDT,a.PUBLISH_EDT,a.MAX_SAL,b.OFFER_DT,b.SALARY  "
            sql = sql & " from vacancy a,offer_tbl b where a.COMPANY_ID=b.COMPANY_ID and a.VACANCY_ID=b.VACANCY_ID "
            sql = sql & " and a.VACANCY_ID='" & vacancyid & "' and a.VAC_STATUS='F'  order by VACANCY_ID"
            cmd.CommandText = sql
            cmd.CommandType = CommandType.Text
            MyDA.SelectCommand = cmd
            Dim myDS As New Vacancy_Test
            MyDA.Fill(myDS, "DataTable1")
     
     '======  Running the report directly with this statement works
            ' ''sql = "select  a.VACANCY_ID,a.VAC_TITLE,a.PUBLISH_SDT,a.PUBLISH_EDT,a.MAX_SAL,b.OFFER_DT,b.SALARY  "
            ' ''sql = sql & " from vacancy a,offer_tbl b where a.COMPANY_ID=b.COMPANY_ID and a.VACANCY_ID=b.VACANCY_ID "
            ' ''sql = sql & " and  a.COMPANY_ID='1' and a.VACANCY_ID=1 and a.VAC_STATUS='F' "
            ' ''sql = sql & " order by VACANCY_ID"
     '===================

            Dim oRpt As New ReportDocument()
            'Dim rpt As New ReportDocument
                   Dim reportPath As String = Server.MapPath("Vacancy-Test.rpt")
            oRpt.Load(reportPath, OpenReportMethod.OpenReportByDefault)
            Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
            Dim p_vacancyid As New ParameterField
            p_vacancyid.Name = "rpt_VacancyID"  ' THE PARAMETER IN THE REPORT
            Dim p_vacancyid_value As New ParameterDiscreteValue()
            p_vacancyid_value.Value = Convert.ToInt32(vacancyid)
            p_vacancyid.CurrentValues.Add(p_vacancyid_value)
            ParamFields.Add(p_vacancyid)
            'oRpt.DataDefinition.ParameterFields()

             oRpt.SetDataSource(myDS)
            CrystalReportViewer1.ReportSource = oRpt


        End Sub

    • Post Points: 5
Page 1 of 1 (1 items)