using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Configuration;
using System.Net;
namespace My.Web.Reports
{
public partial class ReportViewer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ICollection rptParams = new List();
ReportParameter rptParam = new ReportParameter();
rptParam.Name = "Id";
rptParam.Values.Add("101,102");
rptParams.Add(rptParam);
rptParam = new ReportParameter();
rptParam.Name = "name";
rptParam.Values.Add("Assam");
rptParams.Add(rptParam);
ReportViewer1.ServerReport.SetParameters(rptParams);
}
}
}
}
-----------DataSet Query----------------
SELECT ID, Name
FROM Product
WHERE (ID IN
(SELECT items
FROM dbo.Split(@Id, ',') AS Split_1)) AND (Name LIKE '%' + @name + '%')
No comments:
Post a Comment