ganram_76
May 9th, 2002, 07:04 PM
hai guys,
i doing vb.net. i am facing a problem in crystal reports. i want to set a dynamic path for the report. is it possible. if possible let me know.
thanks allot.
bye
ganesh.
vchapran
May 9th, 2002, 10:24 PM
What do you call dynamic path? Do you want to change database or you want to change ReportSource property of CrystalReportViewer?
I'm doing this:
Dim logonInfo as new CrystalDecisions.Shared.TableLogOnInfo()
Dim objTable as CrystalDecisions.CrystalReports.Engine.Table
Dim objReport as new ReportDocument()
Application.DoEvents()
objReport.Load(strFileName)'you assign full path with file name here
' set the logon information for each table.
for Each objTable In objReport.Database.Tables
' get the TableLogOnInfo object.
logonInfo = objTable.LogOnInfo
' set the server or ODBC data source name, database name,
' user ID, and password.
logonInfo.ConnectionInfo.ServerName = "myServer"
logonInfo.ConnectionInfo.DatabaseName = "myDB"
logonInfo.ConnectionInfo.UserID = "myID"
logonInfo.ConnectionInfo.Password = "myPass"
' Apply the connection information to the table.
objTable.ApplyLogOnInfo(logonInfo)
next objTable
CrystalReportViewer1.ReportSource = objReport
If you are using Access as DB, I think (I did not try) you can change Database property of the report object the same way.
Have you already made any installation of your application on User machine? If yes, could you share your experience, please.
Vlad