Solved

An error occurred during local report processing

Posted on 2012-03-21
3
4,195 Views
Last Modified: 2012-03-23
HI,

I am trying to add parameters to a reportviewer control in c# 2010 windows application using the following code but I get an error that

{"An error occurred during local report processing."}         

{"An attempt was made to set a report parameter '@id' that is not defined in this report."}

code:
this.qReportTableAdapter.Fill (this.dsReport.qReport);
          reportViewer1.LocalReport.ReportPath = "Report5.rdlc";
          List<ReportParameter> paramList=new List<ReportParameter> ();
          paramList.Add (new ReportParameter ("@id", nInt.ToString()));
                 this.reportViewer1.LocalReport.DataSources.Clear();
          this.reportViewer1.LocalReport.SetParameters (paramList);
          this.reportViewer1.RefreshReport ();

please help me to fix the problem?

thanks

ayha
0
Comment
Question by:ayha1999
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 37751131
Whether the report file have option to accept the parameter @id?  The @ symbol may not require. Please do refer http://forums.asp.net/t/1240076.aspx/1 and http://www.codeease.com/pass-parameter-to-a-rdlc-report-file.html
0
 
LVL 7

Author Comment

by:ayha1999
ID: 37751647
the code gives no error but the result is not as pe query.


          string nInt ="28";

          this.qReportTableAdapter.Fill (this.dsReport.qReport);
 = "Report5.rdlc";
            ReportParameter rp = new ReportParameter("Id", nInt);
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
            this.reportViewer1.RefreshReport();


I provided Id =28 but it always bring the first record.
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 37760067
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 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