General information
Title:
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
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only