• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

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

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?  
Jamie Fellrath
Jamie Fellrath
  • 2
1 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?
Jamie FellrathApplication Developer/Data AnalystAuthor Commented:
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)
Jamie FellrathApplication Developer/Data AnalystAuthor Commented:
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.  
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now