| | |
How to load crystal Report in my Visual Basic Apllication ?
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2008
Posts: 5
Reputation:
Solved Threads: 0
Hello
I wish to call crystal report in my VB6 Application.
For showing data report i used following code ;
Example
Date report name : datareport1
Code for showing report
Load datareport1
Datreport1.show
I have crystal report named "studentregister". please explain me how can show the crystal report in my vb6 application ?
A.Senthil
I wish to call crystal report in my VB6 Application.
For showing data report i used following code ;
Example
Date report name : datareport1
Code for showing report
Load datareport1
Datreport1.show
I have crystal report named "studentregister". please explain me how can show the crystal report in my vb6 application ?
A.Senthil
If crystal report is installed, then u can find the Crystal Report Viewer OCX control in VB IDE in the components. Add the crystal report control to your form and configure it to show the required report.
Many other properties are also available for the control like to enable print button, to export the report, navigation of pages etc.
Hope this solves ur problem
Regards
Shaik Akthar
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'use whatever is the path of your report 'i have assumes that the rpt file is 'in the application path itself CrystalReport1.ReportFileName = App.Path & "\studentregister.rpt" CrystalReport1.Action = 1
Many other properties are also available for the control like to enable print button, to export the report, navigation of pages etc.
Hope this solves ur problem
Regards
Shaik Akthar
CRViewer can also be used, but the coding will be slightly different
Add the Crystal App references and CrViewer component in References and Components respectively.
Hope this helps u.
Regards
Shaik Akthar
Add the Crystal App references and CrViewer component in References and Components respectively.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'Declare these variable globally in the form module Dim crxApp As New CRAXDDRT.Application Dim crxReport As New CRAXDDRT.Report '------------------------------------------------------------------------------------- Private Sub cmdShowReport_Click() 'Set the report object Set crxReport = crApp.OpenReport (App.path & "\studentregister.rpt") 'Enables the Viewer's Navigation Controls CRViewer.EnableNavigationControls = True 'Disable Group Tree CRViewer.DisplayGroupTree = False 'Enable export button CRViewer.EnableExportButton = True 'Disables the CRViewer's Search control CRViewer.EnableSearchControl = True 'Set the report source CRViewer.ReportSource = crxReport 'View the report CRViewer.ViewReport End Sub
Hope this helps u.
Regards
Shaik Akthar
•
•
Join Date: Aug 2008
Posts: 5
Reputation:
Solved Threads: 0
Thanks a lot Mr. Shaik Akthar
Again i disturb you . I added your code but i got error message
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As New CRAXDDRT.Application
Set crxReport = crApp.OpenReport(App.Path & "\studentregister1.rpt")
( here i got error message " Variable not defined ) ( crapp )
CRViewer.EnableNavigationControls = True
CRViewer.DisplayGroupTree = False
CRViewer.EnableExportButton = True
CRViewer.EnableSearchControl = True
CRViewer.ReportSource = crxReport
CRViewer.ViewReport
Again i disturb you . I added your code but i got error message
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As New CRAXDDRT.Application
Set crxReport = crApp.OpenReport(App.Path & "\studentregister1.rpt")
( here i got error message " Variable not defined ) ( crapp )
CRViewer.EnableNavigationControls = True
CRViewer.DisplayGroupTree = False
CRViewer.EnableExportButton = True
CRViewer.EnableSearchControl = True
CRViewer.ReportSource = crxReport
CRViewer.ViewReport
Hi!
Just change the variable name please, i typed it wrong as crApp instead of crxApp.
Regards
Shaik Akthar
Just change the variable name please, i typed it wrong as crApp instead of crxApp.
Dim crxApp As New CRAXDDRT.Application
Dim crxReport As New CRAXDDRT.Application
Set crxReport = crxApp.OpenReport(App.Path & "\studentregister1.rpt")
( here i got error message " Variable not defined ) ( crapp )
CRViewer.EnableNavigationControls = True
CRViewer.DisplayGroupTree = False
CRViewer.EnableExportButton = True
CRViewer.EnableSearchControl = True
CRViewer.ReportSource = crxReport
CRViewer.ViewReportRegards
Shaik Akthar
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Add data from Excel to Access Table
- Next Thread: SQL Databases
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





