我正在从GridView
的数据制作Crystal-Report
。 GridView
有三列,其中两列用来自DataBase的值填充到标签中,第三列有一个CheckBox,它将这两列的值作为查询字符串发送到Crystal-Report
的.cs页面。列值由存储过程使用,然后结果显示在Crystal-Report
中。 现在我的问题是,如果用户检查两个CheckBox
那么两列的值应该作为数组发送到Crystal-Report
页面。如何GridView
页面后面实现这个如何发送数组中的查询字符串的值
我的代码是
protected void ChkCity_CheckedChanged(object sender, EventArgs e)
{
foreach (GridViewRow row in gdCityDetail.Rows)
{
bool ischecked = ((System.Web.UI.WebControls.CheckBox)row.Cells[0].FindControl("CheckBox2")).Checked;
if (ischecked == true)
{
int getrow = Convert.ToInt32(e.CommandArgument);
Label label1 = (Label)gdVilDetail.Rows[getrow].FindControl("label1");
Label label2= (Label)gdVilDetail.Rows[getrow].FindControl("label2");
Response.Redirect("~/crystal report/Landowner.aspx?Yojna=" + label1.text + "&Village=" + label2.text);
}
和的.cs的Crystal-Report
页上的代码被
private void cityreport()
{
SqlCommand Cmd = new SqlCommand("Showvillage", Constr1);
Cmd.CommandType = CommandType.StoredProcedure;
Cmd.Parameters.Add("@Yojna_No", Request.QueryString[0]);
Cmd.Parameters.Add("@Village_Code", Request.QueryString[1]);
DataSet ds = new DataSet();