CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2017
    Posts
    2

    [RESOLVED] Crystal Report is not displaying

    Good Day! I don't know what is the problem of my code below...When i click the button my Crystal Report is not displaying..No error found also..Please help

    Form2
    Code:
    Option Explicit
    Public Report As New CrystalReport1
    
    Public Function printReport()
    
    Dim strConnectionString As String
    Dim rs As ADODB.Recordset
    Dim strScript As String
    Dim mvcn As ADODB.Connection
     
    strConnectionString = "Provider=SQLOLEDB;Data Source=192.168.15.254;UID=sa;PWD=;Initial Catalog=dbVBTest"
    
    Set mvcn = New ADODB.Connection
    
    mvcn.ConnectionString = strConnectionString
    mvcn.CursorLocation = adUseClient
    mvcn.Open
    
        strScript = strScript & "SELECT * FROM employee" & vbCrLf
    
        Set rs = mvcn.Execute(strScript)
    
        Report.Database.SetDataSource rs
        Report.AutoSetUnboundFieldSource crBMTNameAndValue
    
        CRViewer1.ReportSource = Report
        CRViewer1.ViewReport
    
        Set Report = Nothing
        mvcn.Close
    
    End Function
    Form1
    Code:
    Private Sub Command1_Click()
    
    form2.printReport
    
    End Sub

  2. #2
    Join Date
    Feb 2017
    Posts
    2

    Re: Crystal Report is not displaying

    This thread already solved! Thanks for not helping

Tags for this Thread

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

Featured