would any one be able to tell me on how to simulate a run report function when trying to call a report written in crystal reports XI. or any link that will help me in calling a crystal reports report from vb6 interface will be of great help.

regards,
Ebad

What DB are you using and are usinf RDO or ADO?

What DB are you using and are usinf RDO or ADO?

im using SQL2000 also another question,

im using th efollowing code

while using the refrences,
- Crystal Reports ActiveX Designer Runtime Library 11.0
- Crystal ActiveX Report View Library 11.0


Dim app2 As CRAXDDRT.Application
Dim rap As CRAXDRT.Report
Dim viewreport1 As CrystalActiveXReportViewer
Set app2 = New CRAXDRT.Application
Set rap = New CRAXDRT.Report
Set rap = app2.OpenReport("C:\CLHL\reports\Customer.rpt")
Set viewreport1 = New CrystalActiveXReportViewer
viewreport1.DisplayBorder = True
viewreport1.ReportSource = rap
viewreport1.Zoom (100)
viewreport1.ViewReport

when the event runs the codes, it all runs but nothing shown and also no error is being displayed.

Please do a verify database in crystal reports first. then try to run the report.

How do i get the Crystal Reports ActiveX Designer Runtime Library 11.0 and Crystal ActiveX Report View Library 11.0 references to be in the list of VB6 references?

Thanks.
Phil.Sloan@dsm.com

im using SQL2000 also another question,

im using th efollowing code

while using the refrences,
- Crystal Reports ActiveX Designer Runtime Library 11.0
- Crystal ActiveX Report View Library 11.0


Dim app2 As CRAXDDRT.Application
Dim rap As CRAXDRT.Report
Dim viewreport1 As CrystalActiveXReportViewer
Set app2 = New CRAXDRT.Application
Set rap = New CRAXDRT.Report
Set rap = app2.OpenReport("C:\CLHL\reports\Customer.rpt")
Set viewreport1 = New CrystalActiveXReportViewer
viewreport1.DisplayBorder = True
viewreport1.ReportSource = rap
viewreport1.Zoom (100)
viewreport1.ViewReport

when the event runs the codes, it all runs but nothing shown and also no error is being displayed.

im using SQL2000 also another question,

im using th efollowing code

while using the refrences,
- Crystal Reports ActiveX Designer Runtime Library 11.0
- Crystal ActiveX Report View Library 11.0


Dim app2 As CRAXDDRT.Application
Dim rap As CRAXDRT.Report
Dim viewreport1 As CrystalActiveXReportViewer
Set app2 = New CRAXDRT.Application
Set rap = New CRAXDRT.Report
Set rap = app2.OpenReport("C:\CLHL\reports\Customer.rpt")
Set viewreport1 = New CrystalActiveXReportViewer
viewreport1.DisplayBorder = True
viewreport1.ReportSource = rap
viewreport1.Zoom (100)
viewreport1.ViewReport

when the event runs the codes, it all runs but nothing shown and also no error is being displayed.

I have similar code, and mine runs with no errors, but no report appears. Did you find a solution to why your report never appeared?

Thanks.
phil.sloan@dsm.com

hi,
i am using ADO. i had to pass parameter as well to the report which i have managed to do.

i have to pass parameteres to my report to logon to the sql server for th eexecution of my stored procedure for th eextraction of data.

but after providing the login parameters, it shows error, could not logon to the server.
description of error i am getting
/**crystal report viewer (dialouge)
Logon Failed
details: [database vendon code: 18456]

I am using the following codes.

Dim app2 As CRAXDDRT.Application
Dim rap As CRAXDRT.Report
Dim DB As CRAXDRT.Database
'Dim m_Report As CRAXDRT.ParameterValue
Dim iCustomerId As String
Dim viewreport1 As CrystalActiveXReportViewer
iCustomerId = (lstCustomerList.SelectedItem.ListSubItems(2))

Set app2 = New CRAXDRT.Application
Set rap = New CRAXDRT.Report
'Set DB = rap.database
'DB.LogOnServer "p2ssql.dll", "EMLS", "DBCLHL", "Ebad", "ebad"
Set rap = app2.OpenReport("C:\CLHL\reports\Customers.rpt")
'DB.LogOnServer "p2ssql.dll", "EMLS", "DBCLHL", "Ebad", "ebad"

rap.EnableParameterPrompting = True
rap.EnableParameterPrompting = True
'Delete Previous Report Data
rap.DiscardSavedData
'Clear The Previous Parameter Values
rap.ParameterFields(1).ClearCurrentValueAndRange

rap.ParameterFields(1).AddCurrentValue Val(iCustomerId)
'rap.ParameterFields(2).ClearCurrentValueAndRange
'rap.ParameterFields(2).AddCurrentValue Val(Text2.Text)

rap.Database.LogOnServer "p2ssql.dll", "servername", "dbname", "uname", "pw"

Rem Refresh The Report Component Object
With CrystalActiveXReportViewer1
.ReportSource = rap
.RefreshEx True
.Refresh
.ViewReport
End With
'Close The app2 and rap Object Variable
app2.CanClose
Set app2 = Nothing
Set rap = Nothing

End Sub

Ypu need to have cr installed and all the refrences appear in the refrence list itself.
if not explain ur situation bit more...
ebad

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.