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

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails


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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…

759 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

22 Experts available now in Live!

Get 1:1 Help Now