Solved

An error occurred during local report processing

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
XML to SQL Table using c# 5 45
String manipulation 15 49
Setting runtime form location 4 18
Visual Studio editor? 1 12
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now