Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 05 May 2010 at 3:19am
I'm guessing that the ODBC connection referenced in the report is missing on the machine or the database that the connection is pointing to is missing.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 05 May 2010 at 4:18am
does the connection exist on your machine? if yes, then I am not sure...it's been a while since I had to deal with this sort of issue.
if the connection is not there, I would create it, since changing the connection in the report would cause it to fail on other machines (if everyone uses the same report)
'try this code and desain the report from SQLADO don't from the SQL 'Native Client.. 'first you must write this code.. Imports System.Data.SqlClient Imports CrystalDecisions.Shared Imports CrystalDecisions.CrystalReports.Engine ' ' ' write this code in event click Dim crtableLogoninfos As New TableLogOnInfos() Dim crtableLogoninfo As New TableLogOnInfo() Dim crConnectionInfo As New ConnectionInfo() Dim CrTables As Tables Dim crReportDocument As New repPinjam_tabung crReportDocument.Load(Application.StartupPath & "\report.rpt") With crConnectionInfo .ServerName = "server" .DatabaseName = "database" .UserID = "user" .Password = "password" End With CrTables = crReportDocument.Database.Tables For Each CrTable As Table In CrTables crtableLogoninfo = CrTable.LogOnInfo crtableLogoninfo.ConnectionInfo = crConnectionInfo CrTable.ApplyLogOnInfo(crtableLogoninfo) Next crReportDocument.Refresh() ' print to print Dialog crReportDocument.PrintToPrinter(1, False, 1, 1)
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