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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starter in Crystal Report.

Status
Not open for further replies.

brahman

Programmer
Apr 17, 2003
21
IN
Dear group mates,

I have done report generation in VB but am new to crystal reports can anybody help me from where can I get help to start how to use crystal reports, from begining.

Thanx a lot in advance.

bye for now
amit
 
Reference the following :
* Crystal Report Viewer Control - C:\Program Files\Microsoft Visual Studio\VB98\crviewer.oca
*Crystal Report 8 ActiveX Designer Run Time Library - C:\Program Files\Seagate Software\Report Designer Component\craxdrt.dll

Add component :
Crystal Report Viewer Control - C:\Program Files\Microsoft Visual Studio\VB98\crviewer.oca

Some code:
Dim CrxApp As CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report
Dim NewReportName As String
Dim iCount As Integer

NewReportName = App.Path & "\" & sReport

On Error Resume Next

Set CrxApp = New CRAXDRT.Application
Set CrxRpt = CrxApp.OpenReport(NewReportName)

CrxRpt.Database.Tables(1).SetLogOnInfo strServer, strDB, "UserName", "Password"

'Make sure Crystal points to right database
CrxRpt.Database.Tables(1).Location = strDB
& ".dbo.TableName"

For iCount = 1 To CrxRpt.ParameterFields.Count
CrxRpt.ParameterFields
(iCount).ClearCurrentValueAndRange
If CrxRpt.ParameterFields(iCount).Name = "{?RunFrom}" Then
CrxRpt.ParameterFields(iCount).AddCurrentValue
DateValue
Else
CrxRpt.ParameterFields(iCount).AddCurrentValue
DateValue
End If
Next iCount

'Any data with report wiped
CrxRpt.DiscardSavedData

'Set Viewer control
crvPM.ReportSource = CrxRpt

ERR.Clear
'So that Crystal doesn't prompt with Parameter selection
CrxRpt.EnableParameterPrompting = False

crvPM.ViewReport

Hope this hepls.
Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top