this is wht i did in my project
first design ur report thru crystal reports
in a form(vb) u just add the crviewercontrol
then write the code using this logic
Private Sub cmdReportOK_Click()
Dim m_Report As CRAXDDRT.Report
Dim m_Application As New CRAXDDRT.Application
Set m_Report = Nothing
Set m_Report = m_Application.OpenReport(App.Path + "\myreport.rpt", 1)
m_Report.ParameterFields.Item(1).AddCurrentValue cmbReport.Text
m_Report.ParameterFields.Item(2).AddCurrentValue dtpFrom.Value
m_Report.ParameterFields.Item(3).AddCurrentValue dtpTo.Value
With CRViewer1
.EnableExportButton = True
.EnablePrintButton = True
.EnableCloseButton = True
.ReportSource = m_Report
.ViewReport
End With
End Sub
anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
first do u have the crviewer in ur components
it will take all the references automatically
otherwise you just select all the related references to crystal reports
let me know wht version of cr u r using
anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
first design the report in crystal reports
add a crystal report viewer in ur form
write the code like in the 2nd post of this thread..
try first if u hav any prob come back to me
anto_nee
Junior Poster in Training
76 posts since Aug 2007
Reputation Points: 12
Solved Threads: 4
Once the report is filled with data the report will be automatically shown.
debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434