0

我一直在處理這個問題超過6個月,當我創建一個數據集和數據集裏面我調用存儲過程,然後調用這個數據集到我的報告中水晶報表),我無法看到參數字段:無法看到使用水晶報表數據集的參數

enter image description here

我嘗試創建一個SqlCommand的參數,然後將參數添加到使用 rpt.setParameters(「@一」我的報告」樣品」); 但我得到一個錯誤。

我該怎麼辦?請幫助我,我很desperated和angustied這個

我的代碼(很抱歉,如果這是在西班牙):

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") 
+0

哪些參數你期待? '存儲過程'參數? –

+0

是的,我期待存儲過程參數,請幫助我,我絕望與此,謝謝在建議 –

+0

什麼是錯誤? – jrummell

回答

0

您需要更改您的數據源。由於您使用dataset作爲數據源,因此您已經獲得過濾結果。

您需要使用stored-procedure作爲數據源,然後參數將出現

+0

我已經這樣做了,看我的代碼(對不起,如果是西班牙文): 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」) –