private static string Conn = ConfigurationManager.AppSettings["Str_Conn_14"].ToString();
protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
//{
// this.Report();
//}
}
public void Report()
{
ReportDocument RpDoc = new ReportDocument();
string path = Server.MapPath("CrystalReport12.rpt");
RpDoc.Load(path);
SqlConnection SqlConn = new SqlConnection(Conn);
SqlDataAdapter dpt = new SqlDataAdapter(" select * from dbo.tb_19", SqlConn);
DataSet ds = new DataSet();
dpt.Fill(ds);
RpDoc.SetDataSource(ds);
this.CrystalReportViewer1.ReportSource = RpDoc;
this.CrystalReportViewer1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
this.Report();
}