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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.


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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

617 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