Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Open Connection is failing Post Reply Post New Topic
Author Message
snufse
Newbie
Newbie


Joined: 19 Mar 2008
Location: United States
Online Status: Offline
Posts: 36
Quote snufse Replybullet Topic: Open Connection is failing
    Posted: 13 May 2009 at 7:36am
I have an asp application that runs a Crystal Report (pull method). I dont't seem to get past error in my connection. I need the Crystal Report connect to different servers depending upon user selection. The data base and sign on are always the same. 
 
Here is my attempt:
 

Dim myPath As String = (Server.MapPath("PlantSalesReport.rpt"))

myCrystalReport1.Load(myPath)

myCrystalReport1.SetParameterValue("Ask-Date", DropDownList2.SelectedValue)

CrystalReportViewer1.ReportSource = myCrystalReport1

CrystalReportViewer1.Zoom(100)

CrystalReportViewer1.Width = 500

Dim myLogin As New ConnectionInfo

myLogin.ServerName = "RG5543"

myLogin.DatabaseName = "C:\Program Files\Astec Industries\WM2000\Data\WM2000DATA.add"

myLogin.UserID = "xxxx"

myLogin.Password = "yyyy"

Dim myTables As Tables = myCrystalReport1.Database.Tables

For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables

Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

myTableLogonInfo.ConnectionInfo = myLogin

myTable.ApplyLogOnInfo(myTableLogonInfo)

myTable.Location = myTable.LogOnInfo.TableName

Next

Now when I runn the app I get error:
 
Failed to open the connection. Failed to open the connection. C:\WINDOWS\TEMP\PlantSalesReport {64260EE9-7818-45DC-8D07-381284D2DEB8}.rpt
 
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.