2013-10-09 50 views
1

在报表查看器11(VS2012)WinForms中,我们在本地RDLC报表中遇到了有关报表参数的奇怪问题。本地报表查看器11(RDLC)不处理应用参数

我们已经建立了消耗报表参数,并显示给用户本地报表:

<?xml version="1.0" encoding="utf-8"?> 
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" 
     xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> 

[...] 

<ReportParameters> 
    <ReportParameter Name="TestValue"> 
    <DataType>String</DataType> 
    <Prompt>ReportParameter1</Prompt> 
    </ReportParameter> 
</ReportParameters> 

[...] 

<Textbox Name="TestValueTextBox"> 
     <KeepTogether>true</KeepTogether> 
     <Paragraphs> 
     <Paragraph> 
      <TextRuns> 
      <TextRun> 
       <Value>=Parameters!TestValue.Value</Value> 
       [...] 
      </TextRun> 
      </TextRuns> 
      <Style> 
</Report> 

在代码中,我们应用参数喜欢这里:

this.View.reportViewer.LocalReport.LoadReportDefinition(reportRdlc); 

ReportParameter rp = new ReportParameter("TestValue", "TEST"); 

this.View.reportViewer.LocalReport.SetParameters(rp); 

报告观众不不应用该值,而是抱怨该值缺失。

在报表查看器10(VS2010)中,这实际上没有任何问题。

有人知道为什么这实际上不适用于Report Viewer 11(WinForms)?

回答

0

我很确定v2012有RDLC模式更改,因此我相信您需要使用正确的模式更新报告。不知道一切都改变了,但它可能会帮助改变这种对于初学者来说,

“的xmlns =” http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition”

我可能是不对,但它表面上看起来至少是你问题的方向。

相关问题