Information générale
Titre:
Create BindReport function
Hello All,
I am trying to develop BindReport function, but when it run, it keeps asking me Dataset username & password ..
what I missed? please help
TIA
Winanjaya
Public Function BindReport(ByVal pSQL As String, ByVal pRptFile As String, ByVal pCRViewer As CrystalDecisions.Web.CrystalReportViewer)
Dim mReturn As Boolean = True
Try
Dim myConnection As New OracleClient.OracleConnection()
myConnection.ConnectionString = GetMatrixConnectionString()
Dim MyCommand As New OracleClient.OracleCommand()
MyCommand.Connection = myConnection
MyCommand.CommandText = pSQL
MyCommand.CommandType = CommandType.Text
Dim MyDA As New OracleClient.OracleDataAdapter()
MyDA.SelectCommand = MyCommand
Dim myDS As New DataSet()
MyDA.Fill(myDS, "MyTable")
Dim oRpt As New ReportDocument
oRpt.Load(pRptFile)
oRpt.SetDataSource(myDS)
pCRViewer.ReportSource = oRpt
pCRViewer.DataBind()
Catch ex As Exception
mReturn = False
Finally
BindReport = mReturn
End Try
End Function
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement