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

Dani AI

Generated

Two separate problems are showing up in this thread: the viewer never displays the report, and the report fails with a database logon error. The first is usually an integration/deployment issue (the ActiveX viewer not registered or not actually placed on the form), the second is almost always a SQL authentication/connection mismatch. ’s suggestion to Verify Database in the designer is a good first step — it will surface schema/connection mismatches the report expects versus the actual database. (userapps.support.sap.com)

Get the runtime/references right before chasing code. Use the Crystal XI Developer/RDC pieces (or the XI runtime MSI) so the VB6 references and the ActiveX viewer appear. If the DLLs exist but you don’t see them in VB6, register the RDC/ActiveX DLLs (run regsvr32 as Administrator). On 64‑bit Windows use the 32‑bit regsvr32 in SysWOW64 to register the 32‑bit CR DLLs used by VB6. Copying single DLLs without the runtime will still fail because of dependencies — reinstalling the CR runtime or using the redistributable is the safer route. (daniweb.com)

When the report runs but prompts or errors for login, set the connection info for every table (and every subreport table) before you process/display the report. With the CRAXDRT object model you can access each DatabaseTable and populate its ConnectionInfo fields (server, database/initial catalog, user id, password), then call DiscardSavedData / refresh. Also verify credentials independently (SSMS, UDL or ODBC test); SQL Server error 18456 is a straight login-failure and usually means the user, password, server/instance or auth mode is wrong. (flylib.com)

Practical checklist: put a CrystalActiveXReportViewer on the form at design time (don’t just New the control), confirm the CR runtime is installed/registered, Verify Database in the designer, set table/subreport connection info in code and call DiscardSavedData, test the SQL credentials separately, and repeat for subreports. These steps address both the “nothing displays” symptom and the 18456 logon failure that and ran into. (userapps.support.sap.com)

Recommended Answers

All 7 Replies

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.

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.

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.