Results 1 to 2 of 2

Thread: Crystal Report Datasource problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    484

    Crystal Report Datasource problem

    Dear all,

    I have created a crystal report at my computer, but as I move the program to another computer, it always pops up an dialog that ask me the server, but I don't want that to happen, can anyone help??

  2. #2
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: Crystal Report Datasource problem

    Hi Playkid
    Try this
    VB Code:
    1. Imports CrystalDecisions.CrystalReports.Engine
    2. Imports CrystalDecisions.Shared
    3.  
    4.         Dim crDatabase As Database
    5.         Dim crTables As Tables
    6.         Dim crTable As Table
    7.         Dim crTableLogOnInfo As TableLogOnInfo
    8.         Dim crConnectionInfo As ConnectionInfo
    9.  
    10.                     Dim crReportDocument As New CrystalReport1
    11.                     crConnectionInfo = New ConnectionInfo
    12.                     With crConnectionInfo
    13.                         .ServerName = "YourServer"
    14.                         .DatabaseName = "YourDB"
    15.                         .UserID = "YourUsername"
    16.                         .Password = "HisPassword"
    17.                     End With
    18.                     crDatabase = crReportDocument.Database
    19.                     crTables = crDatabase.Tables
    20.                     For Each crTable In crTables
    21.                         crTableLogOnInfo = crTable.LogOnInfo
    22.                         crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    23.                         crTable.ApplyLogOnInfo(crTableLogOnInfo)
    24.                     Next
    25.  
    26.                     formula = "{auxprintcorpoenc.login}='" & Utilizador.Login & "'"
    27.                     crReportDocument.RecordSelectionFormula = formula
    28.                     crReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape
    29.  
    30.  
    31.                     CrystalReportViewer1.DisplayGroupTree = False
    32.  
    33.                     CrystalReportViewer1.Zoom(100)
    34.                     CrystalReportViewer1.ReportSource = crReportDocument

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

Posting Permissions

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



Click Here to Expand Forum to Full Width