Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • 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.
                populateProgramList(pstrUserName);
                // Set up DropDown List box for Members selection.
                populateMemberList(lstProgram.SelectedValue.ToString());
                // Set up DropDownListBox for Agency selection
                populateAgencyList(lstProgram.SelectedValue.ToString());
            }

            FillReport();
            cardsReport.Dispose();
        }

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
            InitializeComponent();
            report.SetDataSource(dsReportFiller);

            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?  
0
Jamie Fellrath
Asked:
Jamie Fellrath
  • 2
1 Solution
 
frodomanCommented:
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?
0
 
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)
0
 
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.  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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