如何发送多参数值晶体报告

时间:2015-10-26 14:36:46

标签: asp.net vb.net parameters crystal-reports

我创建了带有2个参数的存储过程
1. @rt_salesman,
2. @rt_name
我一直在努力寻找解决我的案子,但我找不到好的答案。当我点击我的按钮时,我总是收到消息:

  

缺少参数值。

任何人都可以帮助我使用VB在Crystal Report中使用ASP.NET传递多个参数吗?这是我的代码剪辑:

Protected Sub cmdView_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdView.Click
    Dim crpt_ As New ReportDocument

    Dim paramField, paramField1 As New ParameterField()
    Dim paramFields, paramFields1 As New ParameterFields()
    Dim paramDiscreteValue, paramDiscreteValue1 As New ParameterDiscreteValue()

    paramField.Name = "@rt_salesman"
    paramField1.Name = "@rt_name"

    paramDiscreteValue.Value = "input_code"
    paramDiscreteValue1.Value = "input_name"

    paramField.CurrentValues.Add(paramDiscreteValue)
    paramFields.Add(paramField)

    paramField1.CurrentValues.Add(paramDiscreteValue1)
    paramFields1.Add(paramField1)

    paramFields.Add(paramField)
    paramFields1.Add(paramField1)

    crptViewer.ParameterFieldInfo = paramFields
    crptViewer.ParameterFieldInfo = paramFields1

    crpt_.Load(Server.MapPath(Request.ApplicationPath + "/r_salesman.rpt"))
    crpt_.SetDatabaseLogon("user", "password", "mydsn", "mydb")
    crptViewer.ReportSource = crpt_
End Sub

0 个答案:

没有答案