Results 1 to 1 of 1
  1. #1
    Join Date
    Feb 2005
    Posts
    36

    Unanswered: Authorization form when you enter crystal report (using vb.net)

    hey guyz.. i already got this login into crystal report.. but when i want to send the data over... it request for my login information agian.

    the autorization box is in the private sub crystalload()
    the passing the string to the report is in btnGenerate_Click

    here is the code.. pls help me out.. thx



    Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click

    CrystalLoad()


    Dim crReport As New Finale

    'ParameterFieldDefinitions and ParameterFieldDefinition are off the
    'CrystalDecisions.CrystalReports.Engine namespace
    Dim crParameterFieldDefinitions As ParameterFieldDefinitions
    Dim crParameterFieldDefinition As ParameterFieldDefinition

    'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
    'namespace
    Dim crParameterValues As New ParameterValues
    Dim crParameterDiscreteValue As New ParameterDiscreteValue

    'Set String Parameter

    'Set discrete value
    crParameterDiscreteValue.Value = ComboSelect

    'Access first parameter field definition
    crParameterFieldDefinitions = crReport.DataDefinition.ParameterFields
    crParameterFieldDefinition = crParameterFieldDefinitions.Item("ParamName")

    ' Add a parameter value
    crParameterValues = crParameterFieldDefinition.CurrentValues

    crParameterValues.Add(crParameterDiscreteValue)

    ' Apply the current value to the parameter definition
    crParameterFieldDefinition.ApplyCurrentValues(crPa rameterValues)

    crv.ReportSource = crReport

    End Sub


    Private Sub CrystalLoad()

    'Connecting to crystal report using with Login INfo
    Dim crtableLogoninfos As New TableLogOnInfos
    Dim crtableLogoninfo As New TableLogOnInfo
    Dim crConnectionInfo As New ConnectionInfo
    Dim CrTables As Tables
    Dim CrTable As Table
    Dim TableCounter

    'Initializing the report
    Dim crReportDocument As New Finale

    'Connection Information
    With crConnectionInfo
    .ServerName = "127.0.0.1"
    .DatabaseName = "test"
    .UserID = "sa"
    .Password = "qw"

    End With

    CrTables = crReportDocument.Database.Tables
    For Each CrTable In CrTables
    crtableLogoninfo = CrTable.LogOnInfo
    crtableLogoninfo.ConnectionInfo = crConnectionInfo
    CrTable.ApplyLogOnInfo(crtableLogoninfo)
    Next

    End Sub
    Last edited by ryanlum; 03-10-05 at 05:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •