I am using following code in form load.
it works fine on one PC but when i run the same application on other pc with different version of Windows Xp it is asking for database logon for report.
I did tried using my provided login info using code but it is executing front end query as well as query in the report.
Any Suggestions will be appreciated.
Thanks in advance
ConnStr = "PROVIDER=MSDAORA.1;PERSIST SECURITY INFO=FALSE;USER ID=scott;PASSWORD=tiger;DATA SOURCE=orcl"
conObj = New OleDbConnection(ConnStr)
strsql = "select * from emp"
cmdObj.Connection = conObj
cmdObj.CommandText = strsql
daObj.SelectCommand = cmdObj
daObj.Fill(dsObj, "test")
rptDoc.Load("\\server\reports\abc.rpt")
srcCr = rptDoc
srcCr.SetDataSource(dsObj)
CRV.ReportSource = rptDoc
CRV.Show()i used CR viewer of CR XI ,it solved the problem. other system had cr viewer 9.5
Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts
Sunday, February 19, 2012
Friday, February 17, 2012
Database Location Not on Design PC
OS = Windows XP Pro; VB6 Enterprise Edition; Crystal Reports XI Developers Edition.
I have designed and developed several CR reports on my PC at home. This is a "stand-alone" PC that is NOT connected to an internal network.
The production PC, that these reports are going on, the database is on a server. All the tables and field names are the same. The only difference is the location of the database.
After testing on my PC, is there any way to put the Server path in the Database Location so that I can create my setup package here at home?
Thanks,
SamGoto the menu Database->Set Database Location
Then map it to the current db and save the report
I have designed and developed several CR reports on my PC at home. This is a "stand-alone" PC that is NOT connected to an internal network.
The production PC, that these reports are going on, the database is on a server. All the tables and field names are the same. The only difference is the location of the database.
After testing on my PC, is there any way to put the Server path in the Database Location so that I can create my setup package here at home?
Thanks,
SamGoto the menu Database->Set Database Location
Then map it to the current db and save the report
Database location in crystal report
Hello
i am totally new to crystal reports
Do we need to change database location of crystal report after installation at client side
If this is case then if there are 1000 reports, database location has to be changed for each report?
any there some shortcut to do this programmatically or any other wayHi,
use a DataSethttp://support.businessobjects.com/communityCS/TechnicalPapers/rtm_reportingoffadonetdatasets.pdf
or a ReportIni like this:
Private Sub ReportInit(ByVal blRefreshLocation As Boolean)
Dim crSections As Sections
Dim crSection As Section
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim crReportDocument As ReportDocument
Dim crSubreportDocument As ReportDocument
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectioninfo As ConnectionInfo
Dim myArrayList As ArrayList = New ArrayList
'declare an instance of the report and the connectionInfo object
crReportDocument = New ReportDocument
crConnectioninfo = New ConnectionInfo
crReportDocument.Load(mstrReportName)
'pass the necessary parameters to the connectionInfo object
With crConnectioninfo
.ServerName = mstrDBServerName
.DatabaseName = mstrDataBaseName
End With
'set up the database and tables objects to refer to the current report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables and pass in the connection info
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectioninfo
If blRefreshLocation Then
crTable.Location = mstrDataBaseName & ".dbo." &
crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
End If
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
'set the crSections object to the current report's sections
crSections = crReportDocument.ReportDefinition.Sections
'loop through all the sections to find all the report objects
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
'loop through all the report objects to find all the subreports
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
'you will need to typecast the reportobject to a
subreport
'object once you find it
crSubreportObject = CType(crReportObject, SubreportObject)
'open the subreport object
crSubreportDocument =
crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
'set the database and tables objects to work with the
subreport
crDatabase = crSubreportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables in the subreport and
'set up the connection info and apply it to the tables
For Each crTable In crTables
With crConnectioninfo
.ServerName = mstrDBServerName
End With
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectioninfo
If blRefreshLocation Then
crTable.Location = mstrDataBaseName & ".dbo." &
crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
End If
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
End If
Next
Next
crystalReportViewer.ReportSource = crReportDocument
End Sub|||You need to make database connection suggested above or Try to use DSN name
i am totally new to crystal reports
Do we need to change database location of crystal report after installation at client side
If this is case then if there are 1000 reports, database location has to be changed for each report?
any there some shortcut to do this programmatically or any other wayHi,
use a DataSethttp://support.businessobjects.com/communityCS/TechnicalPapers/rtm_reportingoffadonetdatasets.pdf
or a ReportIni like this:
Private Sub ReportInit(ByVal blRefreshLocation As Boolean)
Dim crSections As Sections
Dim crSection As Section
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim crReportDocument As ReportDocument
Dim crSubreportDocument As ReportDocument
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectioninfo As ConnectionInfo
Dim myArrayList As ArrayList = New ArrayList
'declare an instance of the report and the connectionInfo object
crReportDocument = New ReportDocument
crConnectioninfo = New ConnectionInfo
crReportDocument.Load(mstrReportName)
'pass the necessary parameters to the connectionInfo object
With crConnectioninfo
.ServerName = mstrDBServerName
.DatabaseName = mstrDataBaseName
End With
'set up the database and tables objects to refer to the current report
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables and pass in the connection info
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectioninfo
If blRefreshLocation Then
crTable.Location = mstrDataBaseName & ".dbo." &
crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
End If
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
'set the crSections object to the current report's sections
crSections = crReportDocument.ReportDefinition.Sections
'loop through all the sections to find all the report objects
For Each crSection In crSections
crReportObjects = crSection.ReportObjects
'loop through all the report objects to find all the subreports
For Each crReportObject In crReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
'you will need to typecast the reportobject to a
subreport
'object once you find it
crSubreportObject = CType(crReportObject, SubreportObject)
'open the subreport object
crSubreportDocument =
crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
'set the database and tables objects to work with the
subreport
crDatabase = crSubreportDocument.Database
crTables = crDatabase.Tables
'loop through all the tables in the subreport and
'set up the connection info and apply it to the tables
For Each crTable In crTables
With crConnectioninfo
.ServerName = mstrDBServerName
End With
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectioninfo
If blRefreshLocation Then
crTable.Location = mstrDataBaseName & ".dbo." &
crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
End If
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
End If
Next
Next
crystalReportViewer.ReportSource = crReportDocument
End Sub|||You need to make database connection suggested above or Try to use DSN name
Subscribe to:
Posts (Atom)