Crystal Report Viewer failing in C#.NET web form.

Posted on 2007-07-24
Last Modified: 2010-05-18
I am having an issue with a Crystal Report Viewer that I've put into my web form, a C#.NET form.  For some reason, it keeps failing on me and I get an error (not an error, unfortunately, that is going to be of any help here).  

All our data collection methods are done in a web service behind our firewall for security's sake, and then applied to the report on the web form.  I'll make notes of those where I see them.  

My PageLoad:  

        private void Page_Load(object sender, System.EventArgs e) {
            pstrUserName = this.Page.User.Identity.Name;  //a public string variable to hold the username.
            //Instantiate web service object
            cardsReport = new CCCSRInternet.CARDSReport.Report();

            if (!Page.IsPostBack) {
                // Set up DropDown List box for Program selection.
                // Set up DropDown List box for Members selection.
                // Set up DropDownListBox for Agency selection


And the FillReport() procedure:  

        public void FillReport() {
            //Set up Dataset for filling Crystal Report
            DataSet dsReportFiller = cardsReport.GetFundingProgramLeaders(lstProgram.SelectedValue.ToString(), lstMember.SelectedValue.ToString(), lstAgency.SelectedValue.ToString(), chkPR.Checked, chkNPR.Checked, chkPPG.Checked, chkActive.Checked, chkPending.Checked, chkNCI.Checked);

            //Instantiate Crystal Report

            rvFundingProgramLeaders.ReportSource = report;

"report" is the ID of the Crystal Reports report object, rvFundingProgramLeaders is the name of the Crystal Reports Viewer object.  

I have gone through this in many ways:  I've checked to see that the parameters for the webservice are correct.  I've verified that the data from the various controls on the form (lstPrograms, lstMember, etc.) are being collected correctly.  I've run the web service iindependently and the data is returned properly, and I've put a datagrid on the form to ensure that the data is being returned by the web service properly.  The problem seems to be with the final line of FillReport() - rvFundingProgramLeaders.ReportSource = report;

Any thoughts?  
Question by:jfellrath
    LVL 42

    Accepted Solution

    You say you're getting an error - what is the error message?  Does the report show anything or is it blank or does the error occur before the report is rendered?
    LVL 1

    Author Comment

    The error appears to be happening at this point in FillReport():  

    rvFundingProgramLeaders.ReportSource = report;

    I've run tests where I've commented out succeeding lines of FillReport() to come to this conclusion.  The report does not show at all...  Our system is set up, unfortunately, to hide actual error messages from the user and reports them to the developers.  The users get a generic "your error has been reported" screen.  Here's one of the messages sent to developers, though.  

    Message:  Exception of type System.Web.HttpUnhandledException was thrown.       Source:  System.Web     Target Site:  Boolean HandleError(System.Exception)       StackTrace:     at System.Web.UI.Page.HandleError(Exception e)
       at System.Web.UI.Page.ProcessRequestMain()
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    LVL 1

    Author Comment

    I found the problem... for some reason, VS.NET had changed the name of my report viewer object to a generic one, and my report viewer was getting ignored.  Frodoman, I appreciate your time.  

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now