Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I m running Crystal Report from ASP.NET

When I Click Previous, Next, Export or Print Button ----- Full Page Re-loads on every click.

How can i avoid Page Re-load?

Thanks,
Sohrab

What I have tried:

.
C#
<pre lang="C#">
    protected void Page_PreInit(object sender, EventArgs e)
    {
        ReportDocument crystalReport = new ReportDocument();
        if (Session["report1"] == null)
        {
            crystalReport.Load(Server.MapPath("~/CrystalReports01.rpt"));
            DataSet dsCustomers = GetData("select * from ACS");
            crystalReport.SetDataSource(dsCustomers);
            Session["report1"] = crystalReport;
        }
        else
        {
            crystalReport = (ReportDocument)Session["report1"];
        }
        CrystalReportViewer1.ReportSource = crystalReport;
    }</pre>
Posted
Updated 28-Nov-16 0:35am

1 solution

Hi,

you can use ajax update panel to avoid page reloads.Yes those buttons generally loads entire page.

Best way to go with ajax.
 
Share this answer
 
Comments
sohrabahmad 29-Nov-16 0:49am    
I have tried Ajax Update Panel but Page Reload Problem remains same.
Though I can manage using Session in IF Condition BUT Page Postback creates unnecessary overhead to server. performance decrease and user experience decreases.
Could u please advise any other Reporting Tool to use on Web Pages.
Thanks.
preety sunita 29-Nov-16 1:08am    
ohk..just for testing purpose try this add your code in OnPreRender() method.

protected override void OnPreRender(EventArgs e)
{ }

and comment it in from preInit. Dont use ajax and all.
sohrabahmad 7-Dec-16 1:24am    
Problem remains same (page reloading) when i put my code inside
protected override void OnPreRender(EventArgs e)
{ }

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



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