Solved

How I get call cr10 from VB6 by code

Posted on 2007-11-19
9
267 Views
Last Modified: 2008-02-01
I have VB6 with CR10 and I need to know how I could call my reports.
by other words
before with CR6 I was using "Crystal Report Control" from Components and recall the report by the property of (.Reportfilename).

I don't know which Component with CR10 has to be installed and what the code should be writtten.

please advice

Thanks

Mostafa
0
Comment
Question by:Mostafa_ElSadek
  • 4
  • 4
9 Comments
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 20319643
In XI, which should be similar to 10, You have some different options, but for the ActiveX viewer in standard windows, you need to
Add a component to your project "Crystal ActiveX Report Viewer Library 11.0" (you would use 10.0)
Add a reference to your project "Crystal Reports ActiveX Designer Design and Runtime Library 11.0"

put the viewer control on a form

then in code do (the control is named CRViewer)

Dim xtal As New CRAXDDRT.Application
Dim rpt As Report

    Set rpt = xtal.OpenReport("The path and file name of your saved report")
    rpt.ReadRecords
    CRViewer.ReportSource = rpt
    CRViewer.ViewReport

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 20324618
I would recommend you use CRAXDRT.dll.  CRAXDDRT has more functionality but some of the functionality requires you to provide (read purchase) runtime license for each user.  In general the CRAXDRT has all the power you need.

The Crystal controls you used in CR6 have been repplaced by new controls to take advantage of new technology.

I use similar code
Dim xtal As New CRAXDDRT.Application
Dim rpt As Report

    Set rpt = xtal.OpenReport("The path and file name of your saved report")

    CRViewer.ReportSource = rpt
    CRViewer.ViewReport

Do you need to pass any informatiion from the application to the report?

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 20324621
Which edition of Crystal 10 do you have?  You need the Developer or Advanced edition to run reports from VB6.

mlmcc
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:Mostafa_ElSadek
ID: 20333706
I'm using CR10 Product Type: Full , Product version : 10.0.0.533
thanks

Mostafa
0
 

Author Comment

by:Mostafa_ElSadek
ID: 20334690
I tried the above code but it gave me an error message with this line :

Set rpt = xtal.OpenReport(App.Path & "\REPORT\Oil_Stock_Ledger_Main.rpt")

the error message says:              
Run time error "13"
Type mismatch

please advice
Thanks
Mostafa
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 20337035
Did you add CRAXDRT as a program reference?

mlmcc
0
 

Author Comment

by:Mostafa_ElSadek
ID: 20341081
Yes I added in a program reference but still gives me the same error.
Thanks

Mostafa
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 20344452
Do you have another report you can try?

That sounds like it might be an error in the report itself not in your code.

mlmcc
0
 

Author Comment

by:Mostafa_ElSadek
ID: 20344977
THanks man it works now as It dll error.

Thanks

Mostafa
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 104
The remaining text does not appear to be part of the formula error 2 42
VB 6 error 5 in windows 10 but not in XP 7 63
backup program with robocopy 6 45
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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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