Crystal Reports with VB6

Posted on 2003-02-26
Medium Priority
Last Modified: 2008-02-01
I've developed an application in VB that uses Crystal Reports.
In VB when i run the app. (press F5) everything works fine. So, I've created a setup with 'Package and Deployment Wizard' and instaled in the pc where it was created and works ok.
When i installed in other pc the program works ok with the connections to the SQL working fine, but when i try to print and passing something to crystal report in the "SelectionFormula" I get a run time error ('20536' -Unable to connect.Incorrect LogOn Parameters). If the SelectionFormula = "" it prints OK (So, No Filters). What might be the problem?

(Sorry about my english, I'm working on it)
Question by:JParente
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Expert Comment

ID: 8024449
Do you specify the path of the Crystal reports file when you access it from VB? If no then do that, becuase when you install your application on some other machine, the path where your crystal report lies may not be same as that of your developing machine. So at runtime specify the path where the user has installed the application and if the report requires any paratemters to be passed then specify those parameters.

Expert Comment

ID: 8032138
I think I had a simular problem by changing Crystal formulas by VB code. The problem I was facing was that I was using the VB syntax while the Crystal Reports uses the Crystal syntax as default. If you are also using the VB syntax, this can be the solution for your problem.

In Crystal Reports you probably changed this default on your machine to VB syntax but on the pc on which you installed your app this is most likely not the case. This can be solved by setting the syntax to VB before you change the formula. To give you an example I will give a few lines of VB code. In this project I had a report added called JournalReport:

Dim objReport as JournaReport
Dim objFormula as FormulaFieldDefinition

Set objJournalReport = New JournalReport
For each objFormula in objJournalReport.FormulaFields
  If objFormula.FormulaFieldName = "X" then
    objFormula.Parent.FormulaSyntax = crBasicSyntaxFormula
    objFormula.Text = "Formula = " & TypeID
  End If
Next objFormula.

I hope this will help you.

Expert Comment

ID: 8087105
have you given password to the database?
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!

LVL 49

Expert Comment

ID: 8972918
JParente, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Save as PAQ -- No Refund.

DanRollins -- EE database cleanup volunteer
LVL 49

Expert Comment

ID: 8972921
Hi JParente,
It appears that you have forgotten to close 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:

    Save as PAQ -- No Refund.

JParente, Please DO NOT accept THIS comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer

Accepted Solution

Computer101 earned 0 total points
ID: 9668019
PAQed - no points refunded (of 200)

E-E Admin

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

764 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