in this report there's Two types of filters first one for filtering Date via two text box and other one for filtering class type via dropdown. both of them work correctly in stimulsoft designer but dropdown filtering dosen't work in asp.net web page
plz help me
[img]
http://8pic.ir/images/0klmctx0poxzfud6pjy0.png
[/img]
Code: Select all
public partial class Report : System.Web.UI.Page
{
EsmailEntities db = new EsmailEntities();
protected void Page_Load(object sender, EventArgs e)
{
DrpGrpPro();
}
protected void Button1_Click(object sender, EventArgs e)
{
string con = ConfigurationManager.ConnectionStrings["EsmailEntities"].ConnectionString;
string serverlocation = HttpContext.Current.Server.MapPath(string.Empty);
StiReport report = new StiReport();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("connection", con));
report.Load(serverlocation + "\\Reports\\ReportWithFiltermrt.mrt");
report.Dictionary.Variables["SC"].Value = DropDownList1.SelectedItem.Value;
report.Dictionary.Variables["FromDate"].Value = txtFromDate.Text;
report.Dictionary.Variables["ToDate"].Value = txtToData.Text;
}
void DrpGrpPro()
{
DropDownList1.DataTextField = "ClassName";
DropDownList1.DataValueField = "ClassId";
DropDownList1.DataSource = db.TblClass.ToList();
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, new ListItem("انتخاب کنید", "0"));
}
}