Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

crystal report does not work properly

$
0
0

hi

i am working on crystal report 

in which i have more data for that i want to go on next page but when i click on next then in gives me erro:

No valid report source is available.

MyCode Is:

protected void Button1_Click(object sender, EventArgs e)
{
GetData();
}


private void GetData()
{
SqlConnection connection = new SqlConnection(strcon );
SqlCommand command = new SqlCommand("Select * from demoforreport WHERE role='" + TextBox1 .Text +"'", connection);
SqlDataAdapter adapter = new SqlDataAdapter(command);
//Customer _Customer = new Customer();
DataSet dataset = new DataSet();
adapter.Fill(dataset, "demoforreport");
ReportDocument CustomerReport = new ReportDocument();
CustomerReport.Load(Server.MapPath("CrystalReport.rpt"));
CustomerReport.SetDataSource(dataset.Tables["demoforreport"]);
CrystalReportViewer1.ReportSource = CustomerReport;
CrystalReportViewer1.DataBind();

}

help me 

thanks



Viewing all articles
Browse latest Browse all 1507

Trending Articles