3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by choudhuryshouvi
0

try this
look into ur Components in VB
find
"Crystal Report Control"
check it

then in your command button

put this codes

With CrystalReport1
Screen.MousePointer = vbHourglass
.WindowBorderStyle = crptFixedSingle
.WindowState = crptMaximized
.WindowTitle = "Users"
.ReportFileName = App.Path & "\FOLDERNAME\YOURREPORTNAME.rpt"
.WindowShowRefreshBtn = True
.DiscardSavedData = False
.Destination = crptToWindow
.Action = 1
Screen.MousePointer = vbDefault

End With

i used this code in connecting vb6 + CR8.5
maybe its kind of the same

hope it will help u somehow

0

the above code won't work with crpt10.
it is limited to version 8.5 only as their is no crystal report control available with versions 9 and above. all there is crystal report viewer. and its syntax is completely different.

make some googling.

0

ic... soo i wont wont work
maybe i start upgrading my CR to CR10 too, and learn the changes

0

check out this code

Public Sub DailyReportDisplay(Query As String)
   Set CRXReport = CrystalReport2
   Set CRXDb = CRXReport.Database
   CRXReport.DiscardSavedData
   inti = 1
   Do Until inti = CRXReport.Database.Tables.count + 1
   CRXReport.Database.Tables.Item(inti).SetLogOnInfo strdblocation, "<your table name>",      "<user id>", "<password>"
  inti = inti + 1
  Loop
  CrystalReport2.SQLQueryString = Query
  With FrmReport
   .Show
   .CRV1.ReportSource = CRXReport
   .CRV1.ViewReport
  End With
  Set CRXReport = Nothing
End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.