4,818
社区成员
发帖
与我相关
我的任务
分享 protected void Button1_Click(object sender, EventArgs e)
{
string sqlstr = "select * from T_CheckMain where 1=1";
sqlstr = sqlstr + " and ASN = '" + txtASN.Value + "'";
DB dbd = new DB();
DataSet tableASN = dbd.Select(sqlstr, null);
if (tableASN.Tables[0].Rows.Count > 0)
{
CrystalReportViewer1.Visible = true;
CrystalReportSource1.ReportDocument.Load(Server.MapPath("crgoods.rpt"));
CrystalReportSource1.ReportDocument.SetDataSource(tableASN.Tables[0]);
//CrystalReportSource1.ReportDocument.ParameterFields["ASN"].CurrentValues.AddValue("aa");
CrystalReportSource1.DataBind();
CrystalReportViewer1.ReportSource = CrystalReportSource1;
CrystalReportViewer1.DataBind();
}
else
{
CrystalReportViewer1.Visible = false;
}
}