Urgente!!! CrystalReportViewer

28/04/2005 - 16:27 por Luis Matamoros | Informe spam
Hola a todos

Tengo una base de datos con password, y estoy haciendo
los reportes con Crystal Report 10, cuando diseño el
reporte ingreso el password, cuando lo cargo en VB.NET me
funciona, pero cuando cuando utilizo SelectionFormula me
vuelve a pedir el password.

Alguien sabe que debo hacer por favor es urgente!!!!!!!

Gracias

Preguntas similare

Leer las respuestas

#1 pangolao
19/05/2005 - 22:05 | Informe spam
Luis Matamoros wrote:

Hola a todos

Tengo una base de datos con password, y estoy haciendo
los reportes con Crystal Report 10, cuando diseño el
reporte ingreso el password, cuando lo cargo en VB.NET me
funciona, pero cuando cuando utilizo SelectionFormula me
vuelve a pedir el password.

Alguien sabe que debo hacer por favor es urgente!!!!!!!

Gracias



Friend Function ViewReport(ByVal sReportName As String, ByVal sReportTitle
As String, Optional ByVal sSelectionFormula As String = "", Optional ByVal
param As String = "") As Boolean

Dim intCounter As Integer
Dim intCounter1 As Integer
Dim strTableName As String
Dim objReportsParameters As ReportViewer
Dim objReport As New ReportDocument
Dim mySection As Section
Dim mySections As Sections

Dim ConInfo As New TableLogOnInfo

Dim paraValue As New ParameterDiscreteValue
Dim currValue As ParameterValues
Dim mySubReportObject As SubreportObject
Dim mySubRepDoc As New ReportDocument

Dim strParamenters As String
Dim strParValPair() As String
Dim strVal() As String
Dim sFileName As String
Dim index As Integer

Try

objReport.Load(sReportName)


intCounter = objReport.DataDefinition.ParameterFields.Count
If intCounter = 1 Then
If
InStr(objReport.DataDefinition.ParameterFields(0).ParameterFieldName, ".",
CompareMethod.Text) > 0 Then
intCounter = 0
End If
End If

If intCounter > 0 And Trim(param) <> "" Then
strParamenters = param
strParValPair = strParamenters.Split("&")
For index = 0 To UBound(strParValPair)
If InStr(strParValPair(index), "=") > 0 Then
strVal = strParValPair(index).Split("=")
paraValue.Value = strVal(1)
currValue objReport.DataDefinition.ParameterFields(strVal(0)).CurrentValues
currValue.Add(paraValue)

objReport.DataDefinition.ParameterFields(strVal(0)).ApplyCurrentValues(currValue)
End If
Next
End If

ConInfo.ConnectionInfo.UserID = "Usuário"
ConInfo.ConnectionInfo.Password = "senha"
ConInfo.ConnectionInfo.ServerName = "servidor"
ConInfo.ConnectionInfo.DatabaseName = "bancodedados"

For intCounter = 0 To objReport.Database.Tables.Count - 1

objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo)
Next

For index = 0 To objReport.ReportDefinition.Sections.Count - 1
For intCounter = 0 To
objReport.ReportDefinition.Sections(index).ReportObjects.Count - 1
With objReport.ReportDefinition.Sections(index)
If .ReportObjects(intCounter).Kind CrystalDecisions.Shared.ReportObjectKind.SubreportObject Then
mySubReportObject CType(.ReportObjects(intCounter),
CrystalDecisions.CrystalReports.Engine.SubreportObject)
mySubRepDoc mySubReportObject.OpenSubreport(mySubReportObject.SubreportName)
For intCounter1 = 0 To
mySubRepDoc.Database.Tables.Count - 1

mySubRepDoc.Database.Tables(intCounter1).ApplyLogOnInfo(ConInfo)
Next
End If
End With
Next
Next

If sSelectionFormula.Length > 0 Then
objReport.RecordSelectionFormula = sSelectionFormula
End If

crvReport.ReportSource = Nothing
crvReport.ReportSource = objReport
crvReport.Show()

Application.DoEvents()

Me.Text = sReportTitle
Me.WindowState = FormWindowState.Maximized
Me.ShowDialog()
Return True

Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Function
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida