Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Crystal Report Error in User Machines

Posted on 2003-03-13
Medium Priority
Last Modified: 2007-12-19
I am working in the maintaince project.

All the Crystal Reports have been developed using FileDsn (Tesco.dsn) connection.

At present we are removing filedsn connection and using the direct sql server connection.

So I have changed the crystal RPT files from filedsn  connection to Microsoft SQL Server connection.[ found in SetLocation->More data Sources].

It works fine in the Crystal Reports and SQL Server installed machines.In the user machines it gives error message "Active X  Componet Can't create object" and I can't locate the required dll.

I tried to preview the .Rpt file in the Crystal Report only installed machine, It gives error message and there is no Microsoft SQL Server connection under SetLocation->More data Sources.

so tell me how to make work with all user machines.
the user machine doesn't have crystal report and sql server.

please help in this regard.
Question by:e_senthil
LVL 101

Expert Comment

ID: 8130027
You must install the SQL client dlls.


Author Comment

ID: 8130594
In my system, lot of dlls are there.

Hence, tell me how to extract the sql client dlls.

and I tried to register some of dlls, but they can't  be registered using regsvr32. It gives "Dll Entry point not found error"
LVL 101

Expert Comment

ID: 8132702
How are you calling the reports?

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 8135293

Here r some Dll's u required for Crystal report..
  cpeaut32.dll, craxddt.dll, craxdrt.dll, crpe32.dll, craxdui.dll, crviewer.dll, crystalwizard.dll,

if you Decleared...
 dim app as new CRAXDRT.Application    ' Decleration

 then close it in form_unload event.
 set app = nothing


Author Comment

ID: 8135778
I am using crystal32.ocx to view the report

with CrystalReport1
 .ReportFileName = App.Path & "\RepPrjSummary_GLPostWAccSpread.rpt"
 .Formulas(0) = "dispSubTitle= 'G/L WIP Posting Detail as of " & MonthName(arrDateMonth(1)) & " " & arrDateMonth(2) & "'"
 .ParameterFields(0) = "@strCondOne;" & " and Acc.ChrProjcode in (Select chrprojcode from tbGenProjectNo where intHostid=" & inthostid & ");TRUE"
 .ParameterFields(1) = "@strCondTwo;" & arrDateMonth(0) & ";TRUE"

  If Not setLogonServer(CrystalReport1) Then
     Exit Sub
  End If

  .Destination = crptToWindow
  .Action = 1

end with


Public Function setLogonServer(obj As Object) As Boolean
On Error GoTo setLogonServer_Error

  Dim crApp     As New CRAXDRT.Application
  Dim crRep     As CRAXDRT.Report
  Dim crSubRep  As CRAXDRT.Report
  Dim crTab     As CRAXDRT.DatabaseTable
  Dim crSec     As CRAXDRT.Section
  Dim subRepObj As CRAXDRT.SubreportObject
  Dim i         As Integer
  Dim j         As Integer
  Dim k         As Integer
 If Trim(obj.ReportFileName) = "" Then
   MsgBox "Error: File name is empty" & vbCrLf & "Please call the setlogonserver function after ReportFileName", vbInformation, "SetLogon Server Failed"
   setLogonServer = False
   Exit Function
 End If
 Set crRep = crApp.OpenReport(obj.ReportFileName)
 For i = 0 To crRep.Database.Tables.count - 1
  obj.LogonInfo(i) = "DSN=" & gstrMySQLServer & ";UID=" & gstrMySQLUserName & ";PWD=" & gstrMySQLPassword & ";DSQ=" & gstrMySQLDataBaseName
 Next i
 For i = 1 To crRep.Sections.count
   Set crSec = crRep.Sections.Item(i)
  For j = 1 To crSec.ReportObjects.count
     If crSec.ReportObjects.Item(j).Kind = crSubreportObject Then
       Set subRepObj = crSec.ReportObjects.Item(j)
        Set crSubRep = crRep.OpenSubreport(subRepObj.SubreportName)
        If (subRepObj.SubreportName <> "") Then
            obj.SubreportToChange = subRepObj.SubreportName
            For k = 0 To crSubRep.Database.Tables.count - 1
              obj.LogonInfo(k) = "DSN=" & gstrMySQLServer & ";UID=" & gstrMySQLUserName & ";PWD=" & gstrMySQLPassword & ";DSQ=" & gstrMySQLDataBaseName
            Next k
        End If
      End If
   Next j
 Next i
 obj.SubreportToChange = ""

setLogonServer = True

   On Error GoTo 0
   Exit Function

   setLogonServer = False
   Call gPrErrorMail(Err.number, Err.description, False, "RightsAssigner", "setLogonServer", Erl, "Rights Assigner")

End Function

The setLogonServer function is used to set the datasource to the report at runtime. I am using LogonInfo method to set the datasource, because my development server(kgislatds) and production server(tesco6) are different.

if I use the connect method or logonserver method, the server name is not changed at runtime. It gives "can't open sql server error".

so I am using CRAXDRT (Crystal Reports 8.5 ActiveX Designer RunTime Library) to find the no of tables in that report and I set the datasource to those tables at runtime using crystal32.ocx LononInfo method.

As perter mentioned,I registered  cpeaut32.dll, craxddt.dll, craxdrt.dll, crpe32.dll, craxdui.dll, crviewer.dll, crystalwizard.dll to all user machines.

 Eventhrough the Error occured in the following line.

 .Action = 1

The error description is


please tell me what are the dlls that I have to register in the user machines.

LVL 101

Expert Comment

ID: 8135924

Expert Comment

ID: 8137184
Hi :)
If you need SQL libraries
You can intstall the OLAP part of SQL Server CD in the client machines, so you will see the reports.

LVL 101

Accepted Solution

mlmcc earned 100 total points
ID: 8140463
I think he just needs the CR dlls for database access.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Screencast - Getting to Know the Pipeline

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question