469,927 Members | 1,649 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

crystal report help


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
Cry.ReportSource = Report
Cry.Zoom 2
Set crystal = Nothing

end sub

please tell why it not display report
Sep 13 '07 #1
3 1233
8,127 Expert 4TB
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)
  3. Set CRXReport = CrystalReport4
  4. Set CRXDb = CRXReport.Database
  5. CRXReport.DiscardSavedData
  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
  13. CrystalReport1.SQLQueryString = Query
  15. With FrmReport
  16. .Show
  17. .CRV1.ReportSource = CRXReport
  18. .CRV1.ViewReport
  19. End With
  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
Thanks but how i can link external (seagate crystal report ) in vb
please tell me.
Sep 14 '07 #3
8,127 Expert 4TB
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.

Similar topics

1 post views Thread by Stephan | last post: by
4 posts views Thread by Rick Thiel | last post: by
2 posts views Thread by Mythran | last post: by
3 posts views Thread by Deasun | last post: by
3 posts views Thread by Milan Todorovic | last post: by
1 post views Thread by bthomas71chevy | last post: by
17 posts views Thread by Peter Proost | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.