Solved

Crystal report fails when programmatically adding parameters.

Posted on 2008-09-30
7
388 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
  • 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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