开发者

"Missing Parameter Values" error on moving to next page of report

开发者 https://www.devze.com 2023-04-09 03:58 出处:网络
I am writing a web application using ASP.NET 2.0 [Visual Studio 2005 Professional Edition]. I have a Crystal Report that is connected to a stored procedure residing in SQL Server. This stored procedu

I am writing a web application using ASP.NET 2.0 [Visual Studio 2005 Professional Edition].

I have a Crystal Report that is connected to a stored procedure residing in SQL Server. This stored procedure accepts a parameter and therefore I have a formula in my report's hyperlink section to pass the parameter via Quer开发者_Python百科y String.

Everything works fine except when I click the navigation buttons to move to the next page of the report, I either get an error or Crystal Reports shows an input box to enter the parameter values.

The error shown is: "Missing Parameter Values". Only this error is shown and nothing else. If I try to export the report by selecting Export option on the Crystal toolbar, it opens a page and asks for the parameter values.

I am not following why parameter values disappear when either I move from the first page to the other or try to export the report?


Most likely you are setting the parameters in the report viewer instead of the report object. If the parameters are set in the report object they should persist on navigation. If you still have issues create an event handler for the report viewer's 'Navigate' event and reset them.


Aditionally, if you call report.Refresh() or report.VerifyDatabase() after you set parameters it clears the values so be aware of that,

MD


When we click on report navigatin button, print button page is refeshed and we facing with 'missing parameter values error '

My probem is solved by using below line of code.

If Not Page.IsPostBack Then CrystalReportViewer1.ParameterFieldInfo = paramFields CrystalReportViewer1.ReportSource = myReportDocument CrystalReportViewer1.DataBind() Else CrystalReportViewer1.ReportSource = myReportDocument CrystalReportViewer1.DataBind() End If

where paramFields are runtime created ParmeterFields

Best Regards, Vinay Shukla

0

精彩评论

暂无评论...
验证码 换一张
取 消