Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vb Front end

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
I have a set of crystal reports. However a VB front is now required. I have a few questions.

Is this difficult?

I want my own parameter input screen, not the cystal one. So I need to pass paras from the VB app to the crystal report.

When the report opens does the who crystal app have to open.

When the report opens i don't the user to see the design view or be able to use the crystal refresh button. All I need is the report to be displayed.

Could anyone tell me how i go about this, or point me in the right direction

ta
 
Assuming you know the basics of VB, this is not very difficult (depending on which technique you use).

You can create paramater fields in CR and then pass values from VB. VB will not load the whole CR app but will only load the runtime engine.

They will not get design view, but can hit refresh unless you disable that button which you can do in the code.

There is some guidance in Seagate's documentation and on their web site. There are third party guides (including my own short one) that give the basics. One popular book is the one by George Peck (The complete reference to CR). Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
You could create a VB application with a minimum of 2 forms. One form would be shown to the user. The user would select the report to run, the parameters, etc. The other form would hold the CRViewer control.

Behind a button on the first form, like "Run", you create an instance of the second form, pass the report name and parameters, and show the form. Like this (Crystal V8)...

Dim crxApplication As New CRAXDRT.Application
Dim crxReport As New CRAXDRT.Report
Dim frmViewerForm As Form2 ' your form with CRviewer control

' create instance of Form2 that has CRViewer
Set frmViewerForm = New Form2
' connect to db
crxApplication.LogOnServer "p2sodbc.dll", "Your DSN n here", "Your DB Name here", "user id here", "password here"
' open the report
Set crxReport = crxApplication.OpenReport("path of RPT here")
' set the first parameter - Index starts at 1 for params
crxReport.ParameterFields.Item(1).AddCurrentValue "XXX"
' point the viewer to the report
frmViewerForm.CRViewer1.ReportSource = crxReport
' show the form / report
frmViewerForm.Show Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
All of the third party guides that I know of (including mine) are for sale, so my guide is not included in the FAQ area. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top