Sunday, March 11, 2012

Crystal report in VB

Hello,

THis is my first time using crystal report and VB6.
Can someone give me some examples on how should I do to preview the report built in crystal report in VB6? After preview, I want to print it out too, using VB.
I found something in the internet that I should use the crystal report control, but I still don't know how to display it...

Cheers!

ClaudiHi,
You can very well use the crystal report control. kindly follow the steps to view crystal report using VB 6.0

1. Open a vb application (Standard EXE).
2. go to Project Menu->components
3. in components list box, get the crystal32.ocx control to add that.
4. design a report using crystal report.
5. then follow the code to view the report from VB.

public sub cmdViewReport_Click()
With
.reportfile=app.path & "\MyReport.rpt"
.WindowTitle = "Report Output"
.WindowState = crptMaximized
.WindowShowGroupTree = True
.WindowShowPrintSetupBtn = True
.WindowShowSearchBtn = True
.Action = 1
End With
End Sub

Hope, this will help....

Regards

Deepak

No comments:

Post a Comment