Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. crystal reports 8.5 continues

crystal reports 8.5 continues

Scheduled Pinned Locked Moved Visual Basic
databasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    slowbutsure29
    wrote on last edited by
    #1

    Hi, this is how i open a report inside VB6 Sub CreateReport(SQL As String, MyConnection As Connection, ReportPath As String, _ ReportTitle As String, OpenMethod As Integer) Dim crApp As New CRAXDRT.Application Dim crRep As New CRAXDRT.Report Dim Rs As New ADODB.Recordset On Error GoTo Err_Proc With Rs .CursorLocation = adUseClient .Open SQL, MyConnection, adOpenKeyset, adLockReadOnly .ActiveConnection = Nothing If .RecordCount > 0 Then Set crRep = crApp.OpenReport(ReportPath, OpenMethod) crRep.Database.SetDataSource Rs ' crRep.Database.LogOnServer "C:\SUKI\Support\crystal\Pdlsql.dll", gStrServer, gStrDatabase crRep.ReportTitle = ReportTitle With frmReportViewer .Caption = crRep.ReportTitle .WindowState = vbMaximized .CRViewer.ReportSource = crRep If OpenMethod = 0 Then 'print directly to printer crRep.PrintOut False, 1, True Else .CRViewer.ViewReport '1=show print layout to user .Show vbModal End If End With Else MsgBox "Record(s) not found.", vbExclamation, App.Title End If .Close End With Set Rs = Nothing Set crRep = Nothing Set crApp = Nothing Exit Sub Err_Proc: Call ErrMsg End Sub Am i forgetting something cause my report is not working. "physical database not found" is always its error. geboy

    T 1 Reply Last reply
    0
    • S slowbutsure29

      Hi, this is how i open a report inside VB6 Sub CreateReport(SQL As String, MyConnection As Connection, ReportPath As String, _ ReportTitle As String, OpenMethod As Integer) Dim crApp As New CRAXDRT.Application Dim crRep As New CRAXDRT.Report Dim Rs As New ADODB.Recordset On Error GoTo Err_Proc With Rs .CursorLocation = adUseClient .Open SQL, MyConnection, adOpenKeyset, adLockReadOnly .ActiveConnection = Nothing If .RecordCount > 0 Then Set crRep = crApp.OpenReport(ReportPath, OpenMethod) crRep.Database.SetDataSource Rs ' crRep.Database.LogOnServer "C:\SUKI\Support\crystal\Pdlsql.dll", gStrServer, gStrDatabase crRep.ReportTitle = ReportTitle With frmReportViewer .Caption = crRep.ReportTitle .WindowState = vbMaximized .CRViewer.ReportSource = crRep If OpenMethod = 0 Then 'print directly to printer crRep.PrintOut False, 1, True Else .CRViewer.ViewReport '1=show print layout to user .Show vbModal End If End With Else MsgBox "Record(s) not found.", vbExclamation, App.Title End If .Close End With Set Rs = Nothing Set crRep = Nothing Set crApp = Nothing Exit Sub Err_Proc: Call ErrMsg End Sub Am i forgetting something cause my report is not working. "physical database not found" is always its error. geboy

      T Offline
      T Offline
      Tushar Kothari
      wrote on last edited by
      #2

      Hi If you remove the line .ActiveConnection = Nothing then you problem may get solved

      Tushar kothari

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups