Solved

Intergating XCrystal Reports into VB

Posted on 2002-03-14
5
129 Views
Last Modified: 2010-05-02
Hi Everyone

I seem to be having a problem trying to incorporate a Crystal Report into VB.

How do I do this and what impact will this have on my deployment?

How can I adjust where the report should look for the access database once it is in VB?

Will the report open in VB or in Word, or in a viewer? Which is best and how do I do it?

Thanks allot for the help
0
Comment
Question by:FRNRIC005
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 100 total points
ID: 6864588
What code are you trying to use?

What version of CR?  What version of VB?

There are many ways to connect VB to Crystal.

The main impact on the deployment is the need to install and register the DLLs and Active X controls used by VB to display the report.

The report can be displayed in a preview screen, sent directly to the printer, exported to various formats including Word and Excel.

It sounds like you are just getting started using VB and Crystal. I would recommend looking at some of the samples provided on the CR web site.  They have full VB applications available that you can download, look at, change, and run to learn how to connect VB and Crystal.

http://support.crystaldecisions.com\
look under SUPPORT  ->  SELF-SERVE SOLUTIONS ->  DOWNLOAD FILES AND UPDATES

A couple of the samples are

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr_print_from_explorer.exe.asp

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/cr8_vb_rdc_parameter.exe.asp

I find using the ActiveX control the easiest simply because I have used it for some time.  I have also used the CR RDC.  

The RDC is the newest method and the preferred from CR's perspective.  

You can change where the report is looking, the query, and many other things.  the method of doing so varies depending on the method chosen to connect to CR.

If you have specific questions feel free to add them or ask new ones.

good luck
mlmcc
0
 

Author Comment

by:FRNRIC005
ID: 6867644
Hi mlmcc

Thanks for your suggestions and you are absolutely correct, I am still new to using Crystal Reports!

I have been pouring over the sample programmes you have sent me and I am able now to bring up a report in the Viewer. I am trying to display a report that has a main report and two sub reports which are linked to the primary key in the primary report. Unfortunately I cant seem to get the report to show upto date data. I dont hink it is accessing the database.

Do I have to do something programmaticaly in VB to make the report access the database, or is it a report setting?

Do I have to re-link all the subreports tot he primary report programmaticaly, or will the report just do it?

Also, one of the methods in the sample programme wont work:

crxReports.parrameterfields.getitembyname("Id")

I'm told that the method is not found.

Can you help me with these problems?

You will be well reward with points if you can hlp me solve this problem!

Thanks

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6870108
Do I have to do something programmaticaly in VB to make the report access the database, or is it a report
setting?

Check the report to ensure you don't have SAVE DATA WITH REPORT checked.  It is under the FILE menu.

Do I have to re-link all the subreports tot he primary report programmaticaly, or will the report just
do it?

You shouldn't have to, the report should maintainthe links.  I have several reports with subreports and use the same code to display them that I use for reports without subreports.

crxReports.parrameterfields.getitembyname("Id")

If the above is from your code you misspelled one word.  Try

crxReports.parameterfields.getitembyname("Id")

I haven't used that feature so if that doesn't work I wouldn't know.  When you type crxReports. does parameterfields show up as an option?  If it does does getitembyname show up after you type the .?

good luck
mlmcc
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7618288
Hi FRNRIC005,
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 mlmcc's comment(s) as an answer.

FRNRIC005, 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.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7665730
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now