Solved

Crystal Report

Posted on 2011-03-16
14
1,071 Views
Last Modified: 2012-08-13
I have designed a report into Crystal report7.0 and add in my vb6.0 project.
But when i add this report into my project, automatically a form created name form1 and CRVIEWER in it. now what must i do to use my report
Please assist me
0
Comment
Question by:crystal_Tech
[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
  • 6
  • 5
  • 2
14 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 35149613
Which edition of CR7 do you have?
You need the developer edition to have the tools to call reports from the application.

What references and components for Crystal did you add to VB?

Check here for examples using the RDC
http://wiki.sdn.sap.com/wiki/display/BOBJ/Report+Designer+Component+SDK+COM+Samples

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35156000

crw32

Seagate Crystal Reports Pro Upgrade   7.0.0.0

component adding in vb project is  crystal report control


0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35159121
You can use the OCX - crystl32.ocx
https://smpdl.sap-ag.de/~sapidp/012002523100006015072008E/splitrpt.zip

OR the RDC - CRAXDRT.DLL - link above

I would recommend the RDC if you have it.

mlmcc
0
Independent Software Vendors: 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!

 
LVL 1

Author Comment

by:crystal_Tech
ID: 35164357

Given link is not opening

Problem loading page

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35165851
I uoloaded the file here

mlmcc
splitrpt.zip
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35166044

Sir
Currently i am Connecting crystal report like this

        CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
        CrystalReport1.Connect = con
        CrystalReport1.DiscardSavedData = True
        CrystalReport1.RetrieveDataFiles        
        CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"
       
            CrystalReport1.Password = Chr(10) & "******"
            CrystalReport1.Destination = crptToWindow
            CrystalReport1.Action = 1

and its working fine

But how to add this reports into vb project.
so no need to install seagate crystal report to the machine

I am gonna deploy this project.

0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 35191613
>>so no need to install seagate crystal report to the machine

If you are deploying to machines, you must install the Crystal Reports runtime ( the DLL's that it needs to run).  You can bundle that with your app when you build your install.  If you are not using the limited version of crystal reports that comes with VB6, I believe you also need a development license, not a Pro license, so you get a deployment key (at least In the current versions).  If you are using the version included with VB6 (I forget what that was), you can deploy that version's runtime.

Google for deploying crystal reports VB6 and you will find lots of stuff, but very little for version 7 which is quite old (so is VB6).  Here is one.  http://www.vbmonster.com/Uwe/Forum.aspx/vb-crystal/1677/Deploying-a-VB6-crystal-report-app
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35191682

Thanks for reply
Please assist me to
how to add this reports into vb project.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35191787
What do you mean how do you add reports to the project?

mlmcc
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35197279
Project > Crystal Report 7 > Import Report (Select Report)
Now Report is in the project,
and Form1 also created automatically,
Crviewer1 is In the Form1
How to use Crviewer1
Normally i am using following code from another form to call "LedgerPort.rpt"

CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
CrystalReport1.Connect = con
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles        
CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"      
CrystalReport1.Password = Chr(10) & "******"
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1

How to use Crviewer1..?
Instead of App.Path what must i write..?
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 35198192
The report object is a non-visual container for opening the file, reading records, etc., not a viewable control.  The CRViewer is the viewable control you place on a form.  In general you do this after you do the code you have to open and prepare the report.

    rpt.ReadRecords
    CRViewer.ReportSource = rpt
    CRViewer.ViewReport
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35198325

so
Instead of following code what must i write to view the report

CrystalReport1.ReportFileName = App.Path & "\LedgerPort.rpt"
CrystalReport1.Connect = con
CrystalReport1.DiscardSavedData = True
CrystalReport1.RetrieveDataFiles        
CrystalReport1.SelectionFormula = "{BDl.G_Name} = '" & Text1.text & "'"      
CrystalReport1.Password = Chr(10) & "******"
CrystalReport1.Destination = crptToWindow
CrystalReport1.Action = 1
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 250 total points
ID: 35198384
Since the report is now in the project you don't use the RPT file at all.

You now have a DSR in the application.

I used that method when we first started with Crystal but because there were over 70 reports and whenever a report changed the application had to be recompiled and reinstalled on all 500+ users we dropped that method in foavor of the RDC which is much the same as the OCX you currently use.

I believe you use code like

Dim crRpt as DSRName

You can then use that to assign to the viewer.  I believe you also need to change the references to use the newer dlls like CRAXDRT but I don't recall.

I'll look to see if the samples use the DSR or ROT method.

mlmcc
0

Featured Post

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

Question has a verified solution.

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

How to increase the row limit in Jasper Server.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…

688 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