无法使用带有水晶报告的数据集查看参数

时间:2012-12-07 16:54:42

标签: asp.net stored-procedures parameters crystal-reports dataset

我已经处理这个问题超过6个月了,当我创建数据集并且在de数据集中我调用存储过程然后将此数据集调用到我的报告中(水晶报告)我看不到参数字段:

enter image description here

我尝试在sqlcommand中创建参数,然后使用参数将参数添加到报表中 rpt.setParameters( “@一”, “样品”); 但是我收到了一个错误。

我该怎么办?请帮助我,我非常绝望和对此感到恼火

我的代码(抱歉,如果是西班牙文):

Dim cmd As New SqlCommand("prd_generarReporteOP", cn) 
cmd.CommandType = CommandType.StoredProcedure 
cmd.Parameters.Add("@idop", SqlDbType.Int).Value = CInt(Session("idop"))
cmd.Parameters.Add("@producto", SqlDbType.VarChar).Value = ""      
Dim da As New SqlDataAdapter da.SelectCommand = cmd 
Dim ds As New DataSetOP da.Fill(ds, "DataSetOP") 

1 个答案:

答案 0 :(得分:0)

您需要更改数据源。由于您使用dataset作为数据源,因此您已获得过滤结果。

您需要使用stored-procedure作为数据源,然后显示参数