Solved

Crystal Report Question - URGENT

Posted on 2000-03-20
10
208 Views
Last Modified: 2010-05-02
Hi

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
0
Comment
Question by:tam97
[X]
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
10 Comments
 
LVL 5

Expert Comment

by:Voodooman
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!


Voodooman!
0
 
LVL 3

Expert Comment

by:g_jones021500
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.
0
 

Author Comment

by:tam97
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
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Expert Comment

by:amarti
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:
http://community.seagatesoftware.com/library/kbase.asp 

For the latest Report Designer Component updates, developer tips and other related information, check out
our Visual Basic developer web page at http://www.seagatesoftware.com/scrvbasic .

0
 

Author Comment

by:tam97
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
0
 
LVL 5

Accepted Solution

by:
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

ReportSource=0-crptReport

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

Now stick a button on the form

Sub Command1_Click()

MyReport.Action=1

End Sub

The Report will open

Good Luck

Voodooman!

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.


0
 

Expert Comment

by:amarti
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

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

End Sub
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 2644783
I have posted a sample VB app that has an example of using the crviewer on my website:
sites.netscape.net/gordonjones/homepage
follow the Visual Basic link , the file link is at the bottom of the page :)

Good Luck!
0
 
LVL 3

Expert Comment

by:g_jones021500
ID: 2644793
I have posted a sample VB app that has an example of using the crviewer on my website:
sites.netscape.net/gordonjones/homepage
follow the Visual Basic link , the file link is at the bottom of the page :)

Good Luck!
0
 

Author Comment

by:tam97
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
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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