C# 如何在rdlc报告中使用本地参数

C# 如何在rdlc报告中使用本地参数,c#,rdlc,C#,Rdlc,我想在rdlc报告中使用变量名ReportTitle的值 我的c#代码是: rdlc代码: <ReportItems> <Textbox name="ReportTitle"> <Value>=Parameters!ReportTitle.Value> </Textbox> </ReportItems> =参数!ReportTitle.Value> 我在中遇到异常错误 setParameter()行 异常

我想在rdlc报告中使用变量名ReportTitle的值

我的c#代码是:

rdlc代码:

<ReportItems>
<Textbox name="ReportTitle">
<Value>=Parameters!ReportTitle.Value>
</Textbox>
</ReportItems>

=参数!ReportTitle.Value>
我在中遇到异常错误 setParameter()行

异常为“本地报表处理过程中出错” 内部异常为“报表定义无效”
内部异常是“Textbox的值表达式引用了一个不存在的报告参数”

在使用它之前,您需要在RDLC中定义一个
ReportParameter

<ReportParameters>
    <ReportParameter Name="ReportTitle">
        <DataType>String</DataType>
        <Prompt>ReportTitle</Prompt>
    </ReportParameter>
</ReportParameters>

一串
报告标题

在Visual Studio中,您还可以使用“视图”>“报告数据”,而不是直接修改RDLC。

已在尝试中,但仍会出现相同的错误
<ReportParameters>
    <ReportParameter Name="ReportTitle">
        <DataType>String</DataType>
        <Prompt>ReportTitle</Prompt>
    </ReportParameter>
</ReportParameters>