C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Passing a Variable to a TextBox in ReportViewer C#.NET WinForm Posted by chip050555 on 21 Jul 2010 at 5:58 AM
Hi All

I am having a problem and been looking for days on passing a variable to a textbox in reportviewer.

Currently I have one date string and eventually will have six that I want to pass to textboxes in my .rdlc report. I am pulling information from a database to place in the report and have constructed a dataset. The dataset does not allow me to pull the dates I need since they are future dates, i.e. timecards/dairycards and the dates are picked from a calendar control, The dates are stored as variables and placed in an array for the report.

I keep getting the following error message when I run the report:

LocalProcessingException was unhandled.

Microsoft.Reporting.WinForms.LocalProcessingException was unhandled

Message="An error occurred during local report processing."

Source="Microsoft.ReportViewer.WinForms"

Below is my code for the btnRun_Click event:

private void btnRun_Click(object sender, EventArgs e)
        {
            reportViewer1.ProcessingMode = ProcessingMode.Local;
            LocalReport localReport = reportViewer1.LocalReport;
            reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
            
            string param0 = GlobalClass.GlobalVar;
            ReportParameter inputdata = new ReportParameter("inputdata", param0);
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] {inputdata});
             
            // TODO: This line of code loads data into the 'AttendanceDataSet.EMPLOYEES' table. You can move, or remove it, as needed.
            this.EMPLOYEESTableAdapter.Fill(this.AttendanceDataSet.EMPLOYEES);
            
            this.reportViewer1.RefreshReport();
        }


I have highlighted the line of code that the exception is thrown at.

I do have on my report the textbox expression set as:

=Parameters!inputdata.Value

I have looked everywhere I can think to find a solution. Any advice would be helpful.

Thanks in advance



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.