2015-12-18 26 views
0

經過兩個星期的工作,一個簡單的報告應該需要一天;我在這裏尋找任何人的幫助。 我創建與Microsoft.ReportViewer.WebForms.dll的12版本的本地報告,我使用VS 2015年VB 我有一個報告,報告分,展示了Web表單上,不過分報告未在過濾我設定了參數。RDLC子報表參數不過濾。 VS 2015

我按照https://msdn.microsoft.com/en-us/library/ms160348.aspx和幾乎所有其他的例子,我已經在網上找到。但我不能讓過濾器工作。

這應該很簡單,但事實並非如此。看來過濾器沒有被應用,但我不明白爲什麼。

我不知道你想什麼代碼看到的,但這裏是一些:

後面的代碼:

If Not IsPostBack Then 
     AddHandler ReportViewer1.LocalReport.SubreportProcessing, AddressOf Me.localReport_SubreportProcessing 
    End If 

Catch exc As Exception 
    Exceptions.ProcessModuleLoadException(Me, exc) 
End Try 

末次

「所有我們在這裏做,我們'將數據集綁定到適當的報告數據源**。

私人小組localReport_SubreportProcessing(發送者爲對象,例如作爲SubreportProcessingEventArgs)

e.DataSources.Add(New ReportDataSource("Guardian", "ObjectDataSource2")) 
Me.ReportViewer1.DataBind() 

結束子

ASPX PAGE

<%@ Control Language="vb" AutoEventWireup="true" CodeBehind="View.ascx.vb" Inherits="Christoc.Modules.MyEasyDirectoryDirectory.View" %> 
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> 


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MEZD_DBO %>" SelectCommand="SELECT DISTINCT organization_admin.OrgID FROM Additional_Guardian INNER JOIN Student ON Additional_Guardian.StudentID = Student.StudentID INNER JOIN organization_admin ON Student.OrgID = organization_admin.OrgID WHERE (organization_admin.Admin_Email = @EMail) OR (Student.G1_Email_Address = @EMail) OR (Additional_Guardian.AG_Email_Address = @EMail)"> 
    <SelectParameters> 
     <asp:Parameter Name="EMail" /> 
    </SelectParameters> 
</asp:SqlDataSource> 


<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" DocumentMapWidth="100%" SizeToReportContent="True"> 
    <LocalReport ReportPath="C:\inetpub\MyEasyDirectory\DesktopModules\MyEasyDirectoryDirectory\Student.rdlc"> 
     <DataSources> 
      <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="Student" /> 
      <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="Guardian" /> 
     </DataSources> 
    </LocalReport> 
</rsweb:ReportViewer> 
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="Christoc.Modules.MyEasyDirectoryDir.DataSet1TableAdapters.StudentTableAdapter"> 
<SelectParameters> 
    <asp:Parameter Name="ORGID" Type="Int64" /> 

</SelectParameters> 
</asp:ObjectDataSource> 





<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="Christoc.Modules.MyEasyDirectoryDirectory.GuardianDataSetTableAdapters.Additional_GuardianTableAdapter"> 
</asp:ObjectDataSource> 

下面是報告,即不正確。 報告應根據學生ID進行過濾。如果您查看圖片,參數StudID位於右上角(這是作爲參數傳遞給子報告的內容)。 第二個最正確的數字是應該過濾的數據庫中的數據。

正如你所看到的,第一個記錄只顯示2項,第二和第三記錄應該沒有任何項目。

This is a picture of the report

回答

0

我想這是在2015年VS錯誤我吹散了整個項目,並重新創建它。相同的代碼。但這一次它編譯。 「未記錄的功能」我猜。