Solved

How I get call cr10 from VB6 by code

Posted on 2007-11-19
9
266 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add a task in Outlook from access 11 39
Null as value for Dynamic parameter in CR2008? 9 47
Automatic Email Reminder 4 38
backup program with robocopy 6 21
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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

810 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