sharibabu
asked on
Crystal Reports Problem... Urgent
Hi
I have some problem in connecting viewing the report designed in crystal reports 8 from visual basic 6.
I have created a report in crystal report 8 connecting to database from crystal reports itself and i am successful in completing the report
now i want to call that report from visual basic 6, but i unable to do that. i want to give my own database connection string and query, taking that connection and query it has to display the report.
can anyone help me in solving this problem.
pls let me also know which reference i have to add in the visual basic 6.0
Thanks in advance
Hari.
I have some problem in connecting viewing the report designed in crystal reports 8 from visual basic 6.
I have created a report in crystal report 8 connecting to database from crystal reports itself and i am successful in completing the report
now i want to call that report from visual basic 6, but i unable to do that. i want to give my own database connection string and query, taking that connection and query it has to display the report.
can anyone help me in solving this problem.
pls let me also know which reference i have to add in the visual basic 6.0
Thanks in advance
Hari.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to supply a where clause then,
rptControl.SelectionFormul a = whereclause
rptControl.SelectionFormul
Private mCRXApplication As CRAXDRT.Application
Private mCRXReport As CRAXDRT.Report
Set mCRXApplication =
CreateObject("CrystalRunti me.Applica tion")
Set mCRXReport = mCRXApplication.OpenReport (ReportNam e)
Pass the recordset to the report engine to use as the datasource
mCRXReport.Database.SetDat aSource rs
This recordset must be exactly the same as the one you used in the standalone report
Private mCRXReport As CRAXDRT.Report
Set mCRXApplication =
CreateObject("CrystalRunti
Set mCRXReport = mCRXApplication.OpenReport
Pass the recordset to the report engine to use as the datasource
mCRXReport.Database.SetDat
This recordset must be exactly the same as the one you used in the standalone report
Reference:
Crystal reports 8.5 ActiveX Designer Runtime Library
Crystal report Viewer Control
Crystal reports 8.5 ActiveX Designer Runtime Library
Crystal report Viewer Control
Look at
http://support.crystaldecisions.com/library/kbase/articles/c2002825.asp
http://support.crystaldecisions.com/library/kbase/articles/c2002296.asp
http://support.crystaldecisions.com/library/kbase/articles/c2000957.asp
http://support.crystaldecisions.com/library/kbase/articles/c2003615.asp
hope they help
mlmcc
http://support.crystaldecisions.com/library/kbase/articles/c2002825.asp
http://support.crystaldecisions.com/library/kbase/articles/c2002296.asp
http://support.crystaldecisions.com/library/kbase/articles/c2000957.asp
http://support.crystaldecisions.com/library/kbase/articles/c2003615.asp
hope they help
mlmcc
Hi sharibabu,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Accept n_narayanan's comment(s) as an answer.
sharibabu, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you. DO NOT accept this comment as an answer.
EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:
Accept n_narayanan's comment(s) as an answer.
sharibabu, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you. DO NOT accept this comment as an answer.
EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer
Computer101
E-E Admin
Computer101
E-E Admin
You need something like this:
Dim i As Integer
Dim sreport_name As String
Dim sreport_fund_num As String
Dim sreport_processingdate As String
Dim sprocess_type As String
Dim crapplication As New CRAXDRT.Application
Dim crreport As CRAXDRT.Report
sprocess_type = "REPORT"
sreport_name = "IMPEXTRUndSec.rpt"
sreport_name = App.Path & "\REPORTS\" & sreport_name
Set crreport = crapplication.OpenReport(s
For i = 1 To crreport.Database.Tables.C
crreport.Database.Tables(1
crreport.Database.Tables(1
'MsgBox crreport.Database.Tables(1
Next i
crreport.ParameterFields(1
crreport.ParameterFields(2
frmReport.rptViewer.Report
frmReport.rptViewer.ViewRe
frmReport.Show
Hope this helps.
Chess