By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

crystal report help

P: 21
hello,

i using vb 6 and i did report seagate crystal report .
i want to know how it use in vb . i did some code but it not display anything

code is


Public strReportPath As String
Public strRecordSelection As String
Dim crystal As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report

Private Sub Form_Load()
strRecordSelection = ""
strReportPath = App.Path & "\" & "Report1.rpt"

On Error Resume Next
Set crystal = New CRAXDRT.Application
Set Report = Nothing
Set Report = crystal.OpenReport(strReportPath)

Report.Database.LogOnServer "pdsodbc.dll", stud.mdb, sd

If strRecordSelection <> "" Then
Report.RecordSelectionFormula = strRecordSelection

End If
Report.DiscardSavedData
Cry.ReportSource = Report
Cry.ViewReport
Cry.Zoom 2
Set crystal = Nothing

end sub


please tell why it not display report
Sep 13 '07 #1
Share this Question
Share on Google+
3 Replies


debasisdas
Expert 5K+
P: 8,127
if you are trying todisplay the CR iusing the CR viewer then

Add a crystal report from under the projects menu.

Create from the Crystal report file and save.

then try the following code

Expand|Select|Wrap|Line Numbers
  1. Public Sub MonthlyReportDisplay(Query As String)
  2.  
  3. Set CRXReport = CrystalReport4
  4. Set CRXDb = CRXReport.Database
  5. CRXReport.DiscardSavedData
  6.  
  7. inti = 1
  8. Do Until inti = CRXReport.Database.Tables.count + 1
  9. CRXReport.Database.Tables.Item(inti).SetLogOnInfo strdblocation, "das", "debasis", "debasis"
  10. inti = inti + 1
  11. Loop
  12.  
  13. CrystalReport1.SQLQueryString = Query
  14.  
  15. With FrmReport
  16. .Show
  17. .CRV1.ReportSource = CRXReport
  18. .CRV1.ViewReport
  19. End With
  20.  
  21. Set CRXReport = Nothing
  22. End Sub

You can call this procedure from buttonclock by passing the querystring for the report. so that the report will be dynamic.
Sep 13 '07 #2

P: 21
Thanks but how i can link external (seagate crystal report ) in vb
please tell me.
Sep 14 '07 #3

debasisdas
Expert 5K+
P: 8,127
Thanks but how i can link external (seagate crystal report ) in vb
please tell me.
You need to

Add a crystal report in VB 6.0 from under the projects menu.

Create the report from the external Crystal report file and save.

then follow as suggested in the previous post.
Sep 14 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.