Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Application Server Failed (.Net & CR 10)

Status
Not open for further replies.

Hueby

MIS
Oct 20, 2004
321
0
0
US
Hi all,

I have created a basic application that takes two dates and then runs a CR report.

I'm using the code below to pass the parameter from VB to my Crystal Report.
Code:
cr = New CrystalDecisions.CrystalReports.Engine.ReportDocument
        cr.Load(string to report)

        Dim param1Fields As New CrystalDecisions.Shared.ParameterFields

        Dim param1Field As New CrystalDecisions.Shared.ParameterField
        Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue

        Dim param2Field As New CrystalDecisions.Shared.ParameterField
        Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue

        param1Field.ParameterFieldName = "@rstartdate"
        param2Field.ParameterFieldName = "@renddate"

        param1Range.Value = F1.rstartdate.Text
        param2Range.Value = F1.renddate.Text

        param1Field.CurrentValues.Add(param1Range)
        param2Field.CurrentValues.Add(param1Range)

        param1Fields.Add(param1Field)
        param1Fields.Add(param2Field)

        CrystalReportViewer1.ParameterFieldInfo = param1Fields 'to pass parameter inf.to CRV
        CrystalReportViewer1.ReportSource = cr ' Assign Report Source to CRV
        CrystalReportViewer1.Refresh()

The Crystal Report is sound. I have the parameter entered, and when running a test from CR using some date parameter it pulls just fine.

WHen I try to run it through VB I get these errors:

The report will flash up, and then go to a Big red X.

"Crystal Report Window Form Viewer: The Report Application Server Failed."

"Object reference not set to an instance of an object"

I can run other Crystal reports fine, and i've used this code before. Where do I begin to find out what's wrong??
 
Where are you plugging in your dataset?


Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
I'm not using a dataset in the app. All the database connection happes on the Crystal report side. I'm just passing date parameters through the VB app.
 
You are missing this :

Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.ServerName = ServerName
myConnectionInfo.DatabaseName = "Q-Cycle"
myConnectionInfo.UserID = "sa"
myConnectionInfo.Password = "sa"


Eric De Decker
Visit The Belgium "Visual Basic Group" at
 
Hi eric... do I need to OPEN and CLOSE this, or ??
 
You code is probrably fine. Try recreating the report (ie: make a new report and copy-paste items one at a time) to see if it works. I would test it at multiple points during the recreation as well to make sure the report isn't crapping out on any specific fields or anything.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top