System.ArgumentException: Parameter '#par_param' does not exist on this report - asp.net

First let me say sorry if this has been answered before, but I can't find anything that talks about the problem I am having.
Here is the situation:
I have an ASP web app that uses a SQL DB for data storage and another server for SSRS. I have everything working EXCEPT for pulling the report.
I created the report using BI in visual studio 2015 pro and deployed it to the SSRS server. I am able to connect to the SSRS server and see and execute the report ok.
My problem comes when I try to feed a parameter to the report. I receive the following error:
'System.ArgumentException: Parameter '#par_param' does not exist on this report'
I have traced this to the code behind my VB page for the report viewer load. Here is the code:
Dim param As Microsoft.Reporting.WebForms.ReportParameter
param = New Microsoft.Reporting.WebForms.ReportParameter("#par_param", par_number)
Me.ParReportViewer1.ServerReport.SetParameters(param)
I have Imported Microsot.Reporting.WebForms and the variable par_number has been declared as a global variable.
I have searched and searched for an answer to solve this problem but i can not find one. Can anyone tell me how in the world to get this parameter to work??
If I need to post any other code please just ask.

Use "par_param" instead of "#par_param". I don't think you need the '#'.

Related

Crystal Reports not prompting for parameters

I have a program to churn through some data that uses 3 reports.. recently our network admin upgrade a server to Win 2012 R2. That server is a slightly newer version of crystal reports. My program uses Version=13.0.2000.0.
Since the upgrade to the new server, my 3rd report, which relies on user entered parameter values no longer prompts the user for the values and shows a blank crystal report viewer. The report works fine locally on my machine.
Curious if anyone has run into this problem? Hopefully. Any ideas / Solutions?
Thanks.
Well after 2 days of searching a co-worker pointed me to this blog post -->
https://adilmca.wordpress.com/2013/04/08/visual-studio-2012-crystal-report-not-working-on-windows-server-2012-0x800a1391-javascript-runtime-error-bobj-is-undefined/
Add the report viewer folder to the project and copy in that bit to the webconfig to point to the new folder. I would like to know why this occured, and I will continue digging to figure it out - but for now the problem is solved. Hope this helps someone else.
Thanks.

"Sequence contains no matching element" Error. Is there some limits with SQL Server Express and EF in ASP.Net MVC?

I am building a substantial ASP.Net MVC app using the latest EF and MVC. Suddenly nothing works, every one of my index views now produces the following error when its generates the data to send to the index view:
System.InvalidOperationException {"Sequence contains no matching element"}
This is happening in code that was generated when I added a controller with views. It now effects ALL my index views and there are about 40 of them which all worked previously and now none of them work. The only thing I can think of is that I hit some limit as I am just adding very similar controllers.
I have found the cause of my problem. None of my previous work on this machine will work anymore. They haven't been changed and they were all working. The problem is that anything I run in Visual Studio (VWD 2013 and VS Community 2015) will NOT talk to SQL Express.
I became suspicious and removed the connection string from the problem App and got exactly the same message. I then thought I would try it with Apps that I know worked, but I ran them first before I made any changes and they (five different apps) all produced the same error.
Yet If I look at Server Explorer it still works and it is using the same Web.Config connection string, because when I remark it Server Explorer will not access the database.
As I said from the start this is some internal problem as all the code was generated by Visual Studio and then it all failed, and all my other working Apps fail as well.
I will now test it on a different machine.
I manually rebuilt it all and the problem appeared again when I added the last few Models. So that was not the solution. I got assisatnce on the ASP.Net forum from Krunal who provided a solution that worked and fixed both versions which had the problem.
I was working with Code First from the database. Krunal thought I was using Database first with Designer and suggested I use the Model Browser to refresh my model. You don't get a Model Browser if you used Code First so I added a Database First Design Model which created a EDMX file, I then right clicked on that and opened the Model Browser.
I then rebuilt it and it all worked. I then went back to the original version added an EDMX opened the Model Browser and it all worked fine. As I said from the start it was not a code issue it was an Internal problem with Visual Studio and SQL Express. No code was changed.

crystal reports error when hosting on server

I have a web application which I developed which uses crystal reports for VS 2010. The reports work fine on my machine, but when I publish the web application, I get the following error when loading the report:
Error
This group section cannot be printed because its condition field is nonexistent or invalid. Format the section to choose another condition field. Error in File temp_9b46c401-8cdb-45a6-bade-4d3e37dda1fb {572D2B99-425A-4EC5-A758-6497001368A3}.rpt: Invalid group condition.
I've searched for this and from what I can understand it's a connection issue. But I've checked and the database connection string is fine. Other parts of web application work fine with it. Is there anything else I should be checking for?
I've resolved the issue. It was very frustrating and so I thought I should put this here in case anyone runs into this:
Make sure you have the same version of Crystal Reports Runtime installed on your server as on your development machine. I had 13.0.3 on my development machine and 13.0.1. on my server. Of course crystal reports gave an obscure error which makes it very difficult to know where to look.
After I did this, I kept getting a blank page. This linked help me resolve this issue: http://www.codeproject.com/Questions/287543/Crystal-Reports-not-rendering-when-webpage-is-serv. Apparently visual studio doesn't copy all the necessary files for it to render the reports.
Thanks.
I'm not so sure that the error is because of a database connection issue. If I were you I would look into a few things first:
Make sure that the database fields haven't changed. Is the application accessing the same database when deployed as it does in the development environment?
What about Null values? Have you checked the "Convert Database Null Values" in the Report Options?
What about the groups? Are there any formulas in them or are any of them based on groups? Browse the data to see if you get any errors.
Just because it runs on your development machine doesn't mean the problem isn't in the datasource. Maybe one of your report's formulas is expecting a field to be non-null, and there is a single null entry. Or a date somehow got entered as #01/01/9999# and a formula in the report is expecting a realistic date.
That should get you started and maybe even solve your issue. Give us some more info about the report and the datasource if you can.

RDLC with Subreport fails with upgrade from 8.0 to 10.0

I have a report that I run in an ASP.NET application using the ReportViewer.Common and ReportViewer.Webforms. With the 2005 version (8.0.0.0) of the RDL file (renamed to RDLC), it worked fine in my ASP.NET web app. After upgrading the report to 2008 (10.0.0.0), my report no longer works.
Error is quite extensive, but ends with:
at Microsoft.ReportingServices.OnDemandProcessing.OnDemandProcessingContext.AbortHelper.ThrowAbortException(String reportUniqueName)
at Microsoft.ReportingServices.OnDemandProcessing.OnDemandProcessingContext.CheckAndThrowIfAborted()
at Microsoft.ReportingServices.OnDemandProcessing.RetrievalManager.FetchData(Boolean mergeTran
at Microsoft.ReportingServices.OnDemandProcessing.RetrievalManager.PrefetchData(ReportInstance reportInstance, ParameterInfoCollection parameters, Boolean mergeTran)
What I have done:
I have checked and all parameters for the report are being set.
I set all the data sources with valid DataTable objects. I've checked all the columns are present in my DataTable.
I have a SubReportProcessing event handler setup. The processing steps into this function and I set the necessary DataTable in that function with valid data. This works for each call to the subreport.
Unfortunately, the Report with subreport works fine in the BI Dev Studio. Go figure.
I can .LocalReport.Render() and get an Exception thrown, but the error is really deep in the .NET reporting engine, as described above.
I realize most would say I am missing a parameter. I could be.
How can I debug this report AFTER the subreport datasets have been supplied? Is there some level of tracing I can enable to get more out of the rendering engine?
Another question is: Is there a way to control the timeout of the SubReport Render? I have set the report script manager to 900 seconds (way high).
Thank you in advance for any guidance you might have on debugging this problem.
Dan
Dan.Zemmels#zcsi.net

What installs ReportViewerControl.axd?

Okay, time for a stupid question.
When viewing the browser source code of a ssrs report there is a script tag that references Reserved.ReportViewerControl.axd. There is a query string parameter of the version. What installed component on the web server determines that version #? The reason I ask is I am trying to debug a situation where an installation of our web app (asp.net 3.5) cannot print a report ("Unable to load client control..."), but on our internal machines, we can. I do not have direct access to the web server/db server. I can confirm that I can print directly from the Report Manager. I am trying to piece together any differences b/t the two environments, and one thing I am noticing is the different version query string value.
Our internal says -
Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=9.0.30729.4402&Name=Microsoft.Reporting.WebForms.Scripts.ReportViewer.js"
Client says -
Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=9.0.30729.1&Name=Microsoft.Reporting.WebForms.Scripts.ReportViewer.js"
I am fairly sure it is the Microsoft Report Viewer Redistributable, but I want to make absolute sure. Anyone out there know?
This depends on whether you're using the .NET ReportViewer control on a custom ASP.NET page or whether you're simply using Reporting Services' out-of-the-box viewer. If it is the former, then most likely it's from the Report Viewer Redistributable. If it is the latter, it's from the SQL Server installation.
See if this SO post helps you with your print issue:
ReportViewer Client Print Control "Unable to load client print control"?

Resources