Tuesday, March 18, 2014

SSRS: Pass multiple value in rdlc report stored on report server from asp.net application.

Create a multiple selection report on report service.
Test it by selecting drop down checkboxes.
when it ready:
Add following in asp.net application:
1. 

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
   Namespace="Microsoft.Reporting.WebForms" TagPrefix="SpadezReport" %>

2.
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <SpadezReport:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
            InteractiveDeviceInfos="(Collection)" ProcessingMode="Remote" WaitMessageFont-Names="Verdana"
            WaitMessageFont-Size="14pt" Height="100%" Width="100%">
            <ServerReport ReportPath="/BranchNameWithDropdown" ReportServerUrl="http://192.168.2.12/ReportServer" />
        </SpadezReport:ReportViewer>

3.


List<String> bn = new List<string>() { "Branch1","Branch2","Branch3"
 };
//Parameters values from dropdown.
     
       if (!IsPostBack) {
          var reportParameter = new ReportParameter("pBranchName", bn.ToArray(),false);
          ReportViewer1.ServerReport.SetParameters(reportParameter);
          ReportViewer1.ServerReport.Refresh();
}

No comments: