troubleshooting Question

Using Crystal Report XI in Visual Studion 2008

Avatar of AnandSahoo
AnandSahoo asked on
Crystal Reports.NET ProgrammingC#
8 Comments1 Solution617 ViewsLast Modified:
Hi Team,

Facing little problem in integrating crystal report with asp.net.

I have a windows 2008 R2 server.
Visual Studio 2008 professional edition installed which support Crystal Report.
I also have Crystal Report XI software installed separately.

I used to develope crystal report using crystal report software separately, not in vs2008.where parameter in record selection is like
{open_date} >= {?startdate} and {open_date} <= {?end_date}

Below is my code to display a parameter based crystal report in web page.

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

namespace MISC.Reports
{
    public partial class Reopen_report : System.Web.UI.Page
    {
        protected void Page_load(object sender, EventArgs e)
        {
            ReportDocument report = new ReportDocument();
            report.Load("D:\\Reports\\Reopen_Tickets.rpt");
            report.SetDatabaseLogon("user", "password");            
            Reopen_Report.ReportSource = report;
            Reopen_Report.RefreshReport();
        }

Problems I am facing:-

1. While loading in webpage,it shows the parameter screen first. After parameter input it is very very slow. When I use Crystal report software and use the same report it is faster.

Solutions tried -

        Added Reportsource ID
        Uninstalled crystal XI software

But still the same issue
       


2. The report shows the data after 3 to 4 minutes. After that when I try any action on the crystal toolbar like export,print,next page etc ( Important is export), It is doing a post back and coming back toparameter screen again. Report disappears.

Solution Tried :-
      changed the page_load to page_init  --  After that it does not show the export pop up at all. It is like loading loading and done.

     Added postback code as below both using page_load and page_init and Session variable.

protected void Page_load(object sender, EventArgs e)
        {
if(!page.ispostback)
{
            ReportDocument report = new ReportDocument();
            report.Load("D:\\Reports\\Reopen_Tickets.rpt");
            report.SetDatabaseLogon("user", "password");  
           Session.Add("report1",report);        
            Reopen_Report.ReportSource = report;
            Reopen_Report.RefreshReport();
        }
else
{
Reopen_Report.ReportSource = Session["report1"];
            Reopen_Report.RefreshReport();
}
}

But still the same issue.

Can you help me to resolve these 2 issues please ?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros