Crystal Report Question - URGENT

Posted on 2000-03-20
Last Modified: 2010-05-02

I've been working with VB5 and the shipped version of Crystal Reports 4.6
viewing reports using CrystalReport1.Action = 1.

I've now moved onto VB6 and Crystal Report Version 8 Pro.

Using the CrystalReport component from 4.6 brings up a run-time error.

Do I need to use the CRViewer component and if so, what coding is required to locate the report and view it in the VB application form?.

Thanks in advance.

Rgds Tam97
Question by:tam97
  • 3
  • 3
  • 2
  • +1

Expert Comment

ID: 2639462
Whats the error you are getting?

I open 4.6 Pro Reports with Ver 7.0 no problem.

I dont use the viewer its poo!


Expert Comment

ID: 2640351
I use the crviewer... it gives me maximum flexibility (unless you want to go to APIs... that's difficult).

You may want to open your 4.6 report in Crystal itself and save it as a ver. 8 report then try it.

Another thing maybe that you say you are using the 4.6 component... Ver.8 has a crystal report OCX that you should upgrade to.

Author Comment

ID: 2641977
g jones

I also want to use the crviewer as it's one of the new components that is now available since I upgraded.

Could you advise the procedure and coding you use to display an existing report from the VB application.

Regarding Voodooman's comment, maybe I gave the wrong impression, I can also open 4.6 reports with ver.8, I can also open 4.6 from the VB application using the 4.6 component.

What I need now to do, is open a ver.8 report from the VB application using whatever component is required to do the job.

Any help apprieciated.

Rgds Tam97
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.


Expert Comment

ID: 2643502
I have same problems in Crystal Reports 4.6 presented in VB, when long data exceeds the space provided by design's Report.   By default data space is sufficient, but we can change.   Try to probe with longer space.

You can find sugestion in: 

For the latest Report Designer Component updates, developer tips and other related information, check out
our Visual Basic developer web page at .


Author Comment

ID: 2643834
Hi amarti

Thanks for comment, I've already  tried the knowledge base , with regards to the Report Designer Component, the people that bought me this product just paid out £250 for it, therfore this basic component should be included.

What I really need is the procedure and coding to view an existing report in the VB application using what is available with the product as is, nothing more complicated than that, surely this can be done with a product of this class.

Rgds Tam97

Accepted Solution

Voodooman earned 100 total points
ID: 2643980
OK use the CrystalReport.ocx not the viewer its very easy.

Add the Crystal.OCX to your components (Ver 8.0) - call it myreport

Set the properties of the compontent which you must specify

Destination =0-crpt to window

DataSource - leave Empty


ReportFileName - the name and path of your report that you designed.

Now stick a button on the form

Sub Command1_Click()


End Sub

The Report will open

Good Luck


P.s. The Report Designer is part of CRVer 8.0 you can add it from Components - Designers.

Trust me the above is the best way to run a report - forget the Viewer and the designer - they are underdeveloped and troublsome.


Expert Comment

ID: 2644025
I use these Sub:

  Dest$ - IMP printer, PAN monitor
  Rep$ - Name of report file ("MyReport.rpt")

Sub Reporte(Dest$, Rep$)
  On Error GoTo ErrRep:
  Dim Ko As Object: Set Ko = KRep!CryRep 'Crystal Control
  Ko.ReportFileName = Rep$: Ko.SelectionFormula = Seleccion$
  Select Case UCase$(Dest$)
    Case "PAN"  'Monitor
     KRep.WindowState = 2: Ko.WindowParentHandle = KRep.hWnd  'sets the WindowParentHandle to the handle of Form. This specifies that the print window is to be a child of Form »
     Ko.Action = 1: KRep!KRep1.ZOrder 0: KRep!KRep2.ZOrder 0: KRep!KRep3.ZOrder 0
     'when finish to view
     KRep.Cls: Ko.Action = 0
    Case "IMP"  'Printer
      Ko.Destination = 1
      z$ = InputBox("¿Copies of Reporte?", "REPORT", 1, 100, 100)
      re = Val(z$): If re < 1 Or re > 99 Then re = 1
      Ko.CopiesToPrinter = re: KRep.MousePointer = 11
      Ko.Action = 1
      KRep.MousePointer = 0: CnOf KRep!aviso
  End Select
  Set Ko = Nothing 'for free memory
  Exit Sub

  res = MsgBox(Err.Description, 21)
  If res = 2 Then Exit Sub Else Resume

End Sub

Expert Comment

ID: 2644783
I have posted a sample VB app that has an example of using the crviewer on my website:
follow the Visual Basic link , the file link is at the bottom of the page :)

Good Luck!

Expert Comment

ID: 2644793
I have posted a sample VB app that has an example of using the crviewer on my website:
follow the Visual Basic link , the file link is at the bottom of the page :)

Good Luck!

Author Comment

ID: 2647187
Hi gordon

Have been to your site and downloaded code.

Now I know how much of a beginner I really am, could I ask one more favour of you, in order to focus into exactly what I need could you show me the "cut-down" code for the following scenario.

I have an Access database residing at C:\Staffing, db name is Adobe.mdb, the report I wish to view from the application is called 'Rostering.rpt'(which is already created).

I have a form which runs a query, empties the data table then inserts the new values into the table, the report is linked to this table. I have a button on the form that will 'hopefully' display the report in a new form, it's the coding of this button
I really need and if possible in it's simpliest form.

Sorry if I'm being a pain, hope you can assist.

Best Rgds Tam97

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…
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…

785 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