![](/img/trans.png)
[英]how to pass a parameter value from rdlc report to a method in web forms project?
[英]Pass NULL value to rdlc report Boolean parameter
我有单选按钮列表。 asp代码:
Auditing: <asp:RadioButtonList ID="RBLAudit" runat="server" Font-Bold="true" RepeatDirection="Horizontal" RepeatLayout="Flow" TextAlign="Left">
<asp:ListItem Value="true" Text=" Audited" Selected="True"/>
<asp:ListItem Value="false" Text=" Not Audited "/>
<asp:ListItem Value="" Text="ALL"/>
</asp:RadioButtonList>
我有布尔参数的RDLC报告如下:
我想在选择单选按钮列表的ALL选项时传递空值。 我试试这个代码
If (RBLAudit.SelectedValue <> "") Then
p9 = New ReportParameter("State", RBLAudit.SelectedValue)
ElseIf (RBLAudit.SelectedValue = "") Then
p9 = New ReportParameter("State", DBNull.Value.ToString())
End If
Dim RepParams() As ReportParameter = {p1, p2, p3, p4, p5, p6, p7, p8, p9}
但是当RBLAudit.SelectedValue = ""
时这不起作用。 错误是"The value provided for the report parameter 'State' is not valid for its type."
如何为此布尔参数传递空值?
最后它在非常努力和失败后工作......
If (RBLAudit.SelectedValue <> "") Then
p9 = New ReportParameter("State", RBLAudit.SelectedValue)
ElseIf (RBLAudit.SelectedValue = "") Then
p9 = New ReportParameter("State", New String() {Nothing})
End If
还有其他想法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.