Solved

Crystal report fails when programmatically adding parameters.

Posted on 2008-09-30
7
389 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
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…

713 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