Ref:RDLC (Local SSRS) Report ASP.Net Example using DataSet or DataTable in C# VB.Net and Visual Studio 2010
Download the sample from above link and modify the HTML form:
<form id="form1" runat="server">
<asp:CheckBoxList ID="chkCountryDemo" AutoPostBack="true" OnSelectedIndexChanged="ProductsType_Changed"
runat="server">
<asp:ListItem Text="Mexico" Value="0" />
<asp:ListItem Text="Germany" Value="1" />
<asp:ListItem Text="Sweden" Value="3" />
<asp:ListItem Text="France" Value="4" />
</asp:CheckBoxList>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="600">
</rsweb:ReportViewer>
</form>
Add this Event in code:
protected void ProductsType_Changed(object sender, EventArgs e)
{
string query = "SELECT * FROM customers";
query += " WHERE Country IN (";
foreach (ListItem item in chkCountryDemo.Items)
{
if (item.Selected)
{
query += "'" + item.Text + "'" + ",";
}
}
query = query.Substring(0, query.Length - 1);
query += ")";
Customers dsCustomers = GetData(query);
ReportDataSource datasource = new ReportDataSource("Customers", dsCustomers.Tables[0]);
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(datasource);
}
Thank You