Solved

An error occurred during local report processing

Posted on 2012-03-21
3
4,469 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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