如何将值传递给rdlc报告中的现有参数 [英] How can I pass a value to an existing parameter in a rdlc report
本文介绍了如何将值传递给rdlc报告中的现有参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设计了一个带有txtpayee参数的rdlc报告和一个表达
I design a rdlc report with "txtpayee" parameter and a text box with an expressing of
"=Parameters!txtpayee.value"
我想传递值从我的组合框到我报告中的文本框。问题是,当我尝试这样做时,它会传递值但不会在文本框中传递,而是会创建另一个页面。
我尝试了什么:
I want to pass the value from my combobox to the textbox in my report. The problem is when i try to do it, it pass the value but not in the textbox instead it creates another page.
What I have tried:
Dim params = New ReportParameter
params.Name = "txtpayee"
params.Values.Add(cmb_payee.Text)
With frm_rpt.ReportViewer1
.LocalReport.SetParameters(params)
.RefreshReport()
End With
推荐答案
您应该能够使用SetParameterValue方法。看看 ReportDocument.SetParameterValue方法(String,Object,String) [ ^ ]。
还有一些例子在以编程方式将参数传递到ASP.NET的Crystal Reports(C#) - 第1部分 [ ^ ]
You should be able to use SetParameterValue method. Have a look at ReportDocument.SetParameterValue Method (String,Object,String)[^].
Also there are some example in Programmatically Pass Parameters into Crystal Reports from ASP.NET (C#) - Part 1[^]
这篇关于如何将值传递给rdlc报告中的现有参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文