if I click next, it goes to 2 page, but when I click next again, it is still in 2 page, never can pass page 2. But I can go to last page. If I click previous button, it always goes to 1 page. why it happen? plz help me to sort out this problem thnax in advance :(
UPDATE from OP:
private void ConfigureCrystalReports()
{
try
{
con.Open();
string str = "SELECT cast(A_formthreeA.EST_CODE as nvarchar(12)) as EST_CODE, cast(A_formthreeA.EMP_NO as nvarchar(12)) as EMP_NO, A_formthreeA.TOTWAGES, A_formthreeA.PFT, A_formthreeA.TOTEE, A_formthreeA.TOTER, A_formthreeA.EMP_NAME,A_formthreeA.FinYr, company_details.company_name,";
str += "company_details.comp_address1, company_details.comp_address2,company_details.pf_city_init, company_details.pf_state_init ";
str += " FROM A_formthreeA INNER JOIN company_details ON A_formthreeA.EST_CODE = company_details.pf_Code ";
TextObject txtFrom, txtTo;
SqlCommand cmd = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
rpt.Load(Server.MapPath("..") + "\\Report\\form6A.rpt");
rpt.SetDatabaseLogon("sa", "Gnk1961", "SUPER/SQLEXPRESS", "Dummy");
txtFrom = (TextObject)rpt.ReportDefinition.ReportObjects["txtFrom"];
txtTo = (TextObject)rpt.ReportDefinition.ReportObjects["txtTo"];
rpt.SetDataSource(dt);
rpt.SetParameterValue("est_code", drp_compname.SelectedValue.Trim());
rpt.SetParameterValue("finyr", txt_year.Text);
txtFrom.Text = txt_year.Text;
if (txt_year.Text != "")
{
txtTo.Text = Convert.ToString(Convert.ToInt16(txt_year.Text) + 1);
}
}
catch(Exception e)
{
e.Message.ToString();
}
showReport(rpt);
con.Close();
}