Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi I am using the crystal report in asp.net VS 2008. I use the crystal report using coding and when I am try to move on next page after the 2nd page, it does not move next and retain on 2nd page. So what the problem that I do not understand yet ? so please help me....

Regards...
Mitesh
Posted
Updated 5-Jun-12 5:07am
v2
Comments
Herman<T>.Instance 5-Jun-12 5:23am    
something in Page_load should be set in Page_Init event. Please share your code so we can help you
[no name] 18-May-17 6:22am    
protected void Page_Init(object sender, EventArgs e)
{
ConfigureCrystalReport();
}

1 solution

Digimanus is right. Move your code from Page_Load() to Page_Init()

Also check my past answer.
Problem in Crystal Report toolbar ASP.Net[^]
 
Share this answer
 
Comments
[no name] 6-Jun-12 0:50am    
i use the code in Page_Load() but when on next page it not works.
protected void Page_Load(object sender, EventArgs e)
{
user_name = Request.QueryString["user_name"];
c.setcon();
string name = "select id from empl where name=" + user_name + "";
SqlDataAdapter ad = new SqlDataAdapter(name, c.getcon());
DataSet ds = new DataSet();
ad.Fill(ds);

if (ds.Tables[0].Rows.Count != 0)
{
String data = "SELECT document.title, empl.name, user_doc.cat,user_doc.user_id,user_doc.sub_cat FROM empl INNER JOIN user_doc ON empl.ID = user_doc.user_id AND empl.ID = user_doc.user_id INNER JOIN document ON user_doc.doc_id = document.id WHERE user_doc.user_id ='" + ds.Tables[0].Rows[0][0].ToString() + "' order by document.title";
SqlDataAdapter ad1 = new SqlDataAdapter(data, c.getcon());
DataSet ds1 = new DataSet();
ad1.Fill(ds1);

path = Server.MapPath("../Admin/User_Rights_Report.rpt");
cr = new ReportDocument();
cr.Load(path);

cr.SetDataSource(ds1.Tables[0]);
CrystalReportViewer1.ReportSource = cr;

}
else
{

}



}
Ashraful.Net1 7-Dec-19 23:05pm    
its working, thanks
[no name] 6-Jun-12 1:33am    
thanks i solved it.
Prashant Bhujbal 24-Apr-14 10:11am    
after using your code
Digimanus is right. Move your code from Page_Load() to Page_Init()
still gating same problem
thatraja 25-Apr-14 8:11am    
Share your code. Possibly postback giving you the trouble. Check the link in my answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900