Solved

An error occurred during local report processing

Posted on 2012-03-21
3
4,018 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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