-
November 21st, 2008, 12:45 AM
#1
Visual basic 6 with crystal report
I Wish to pass parameter in Crystal Report. I have Access data base one table named
student. I with to select range of data's from that table field named "rno"
i am using visual basic 6
I used following code to view crystal report
================================================
Set rs = New ADODB.Recordset
modConnection.opendb
rs.Open "select * from STUDENT_M order by rno", cn, adOpenStatic, adLockPessimistic
Report.Database.SetDataSource rs
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
==========================================
I am new to crystal report. please guide me how to use parameter in crystal report.
a.Senthil kumar.
-
November 23rd, 2008, 11:43 AM
#2
Re: Visual basic 6 with crystal report
Something like this should work:
Code:
Set m_Application = New CRAXDRT.Application
Set m_Report = New CRAXDRT.Report
Set m_Report = m_Application.OpenReport(App.Path & "\ReportName.rpt", 1)
m_Report.EnableParameterPrompting = False
Set m_Parameters = m_Report.ParameterFields
For cnt = 1 To m_Parameters.Count
Set m_Parameter = m_Parameters.item(cnt)
If m_Parameter.name = "{?testcode}" Then
m_Parameter.AddCurrentValue "12345"
End If
Next
frmReportView.CRViewer1.ReportSource = m_Report
frmReportView.CRViewer1.ViewReport
frmReportView.Show
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|