Solved

Crystal report fails when programmatically adding parameters.

Posted on 2008-09-30
7
390 Views
Last Modified: 2008-10-08
I have a web page in ASP.net development. This page has a CrystalReportDataSource and a CrystalReportViewer. I set the ReportSources file name at runtime and databind the ReportView. This works both on my development side and the production (IIS 6.0) side. However, when I try to add a parameter with the following code:

Dim Week As CrystalDecisions.Web.Parameter
Week = New CrystalDecisions.Web.Parameter
Week.Name = "Week"
Week.DefaultValue = "1"
ReportDataSource.Report.Parameters.Add(Week)

It works fine on the development or my local copy but when I publish it to the web server it says:
"The report you requested requires further information"
It then throws up a generic authentication screen, with the sql servers name in the server name box.
The page has a box for the database name but it is empty, and even after authenticating numerous times as the sql account that we are using it does not change its mind.
I am not seeing any error on the application log.

Any ideas?

0
Comment
Question by:jpwallen
[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
  • 3
  • 3
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22611015
Are you trying to add a new parameter to the report at runtime?

mlmcc
0
 
LVL 1

Author Comment

by:jpwallen
ID: 22613334
No; I am trying to supply a parameter to the report at runtime. The report already has the parameter set up if that is what you are asking.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22614286
Check this document.  The parameter passing starts on page 148.
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

It may also be you are missing a dll.  Check the installation setups starting on page 434

mlmcc

0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 22614569
Can you not use the SetParameter function? Also, try by supplying the login information programmatically to the report. You would need to use the ApplyLogonInfo for each table used in the report.
0
 
LVL 1

Author Comment

by:jpwallen
ID: 22626674
I have tried the SetParameterValue and tried programmatically setting the logon info for each table in the report. The report works fine on the local development copy but when I publish it to the production site the report fails. The crystal reports book describes the "wrong" way to use crystal reports in ASP.net. Our company has been using the way of creating a crystal reports document programmatically and setting a report viewers datasource to that, and it fills up the cache rather quickly. After about 60 reports are ran the cacle overflows and we are forced to recycle the application pool. I think this has to do with the reports not closing and disposing themselves after they have been used. I have found that the correct way of running reports in ASP.net is to use the CrystalReportsDataSource control which has a cache expiration timer built in. Any other ideas?

The crystal reports that we are using uses an ADO.net connection to SQL and a specific username and password.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22626749
0
 
LVL 1

Accepted Solution

by:
jpwallen earned 0 total points
ID: 22635207
I figured this one out on my own. While looking at the tutorials for creating a crystal report in ASP.net for Visual Studio 2005, I seen that they did everything exactly like I did except they used an ODBC connection. So I created a new ODBC connection in my reports and reset the location of the old tables to the ODBC one and it works like a charm. Now, I recall that the ADO.net connection is flaky for some reason. I think it had to do with a schema problem. Nevertheless though; I had to create a ODBC connection on my computer to actually get it to work, and then create the exact same connection on the server. It also seems to be a little faster this way but that could just be me.

The tutorial I used was:
http://msdn.microsoft.com/en-us/library/ms227806%28VS.80%29.aspx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Send parameters via datatable ajax call 4 47
What are MicroServices? 4 68
Difference between Highcharts and Mapbox 10 45
ErrorKind in crystal reprot VB.Net 1 13
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

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